text stringlengths 2 1.04M | meta dict |
|---|---|
package parallelai.spyglass.jdbc.testing
import com.twitter.scalding.TextLine
import com.twitter.scalding.Args
import com.twitter.scalding.Tsv
import com.twitter.scalding.mathematics.Matrix._
import scala.math._
import scala.math.BigDecimal.javaBigDecimal2bigDecimal
import cascading.tuple.Fields
import cascading.pipe.Pipe
import com.twitter.scalding.Osv
import parallelai.spyglass.base.JobBase
import parallelai.spyglass.jdbc.JDBCSource
class HdfsToJdbc (args: Args) extends JobBase(args) {
implicit val implicitArgs: Args = args
val scaldingInputPath = getString("input.scalding")
log.info("Scalding sample input path => [" + scaldingInputPath + "]")
val S_output = scaldingInputPath
val fileType = getString("fileType")
log.info("Input file type => " + fileType)
val S_SCHEMA = List(
'key_id, 'col1, 'col2, 'col3
)
val url = "mysql01.domain"
val dbName = "db"
val tableName = "table"
val jdbcSource2 = new JDBCSource(
"db_name",
"com.mysql.jdbc.Driver",
"jdbc:mysql://<hostname>:<port>/<db_name>?zeroDateTimeBehavior=convertToNull",
"user",
"password",
List("KEY_ID", "COL1", "COL2", "COL3"),
List( "bigint(20)" , "varchar(45)" , "varchar(45)" , "bigint(20)"),
List("key_id"),
new Fields("key_id", "col1", "col2", "col3")
)
var piper:Pipe = null
if (fileType equals("Tsv"))
piper = Tsv(S_output, S_SCHEMA).read
else
piper = Osv(S_output, S_SCHEMA).read
val S_FLOW =
Tsv(S_output, S_SCHEMA).read
.write(jdbcSource2)
} | {
"content_hash": "f9ba8a85fa191857510c19310b8f7277",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 80,
"avg_line_length": 27.56140350877193,
"alnum_prop": 0.6702737110120942,
"repo_name": "kristiankaufmann/SpyGlass",
"id": "33d12f72092311ef5c7ec0877778a3aa2784c7fb",
"size": "1571",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/main/scala/parallelai/spyglass/jdbc/testing/HdfsToJdbc.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "256712"
},
{
"name": "Scala",
"bytes": "65182"
}
],
"symlink_target": ""
} |
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 12">
<meta name=Originator content="Microsoft Word 12">
<link rel=File-List href="SqlNumericInjection_files/filelist.xml">
<link rel=Edit-Time-Data href="SqlNumericInjection_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>egeirnaert</o:Author>
<o:LastAuthor>egeirnaert</o:LastAuthor>
<o:Revision>2</o:Revision>
<o:TotalTime>36</o:TotalTime>
<o:Created>2007-07-11T11:07:00Z</o:Created>
<o:LastSaved>2007-07-11T11:07:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>86</o:Words>
<o:Characters>495</o:Characters>
<o:Company> </o:Company>
<o:Lines>4</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>580</o:CharactersWithSpaces>
<o:Version>12.00</o:Version>
</o:DocumentProperties>
</xml><![endif]-->
<link rel=themeData href="SqlNumericInjection_files/themedata.thmx">
<link rel=colorSchemeMapping
href="SqlNumericInjection_files/colorschememapping.xml">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:TrackMoves>false</w:TrackMoves>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="0" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="0" Name="Hyperlink"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="0" Name="Normal (Web)"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-alt:"\FF2D\FF33 \660E\671D";
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:1;
mso-generic-font-family:roman;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:0 0 0 0 0 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:1627400839 -2147483648 8 0 66047 0;}
@font-face
{font-family:"\@MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman","serif";
mso-fareast-font-family:"Times New Roman";}
h1
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-link:"Heading 1 Char";
mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:1;
font-size:16.0pt;
font-family:"Arial","sans-serif";
mso-fareast-font-family:"MS Mincho";
mso-font-kerning:16.0pt;
mso-fareast-language:JA;
font-weight:bold;}
h2
{mso-style-priority:9;
mso-style-qformat:yes;
mso-style-link:"Heading 2 Char";
mso-style-next:Normal;
margin-top:10.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan lines-together;
page-break-after:avoid;
mso-outline-level:2;
font-size:13.0pt;
font-family:"Cambria","serif";
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:major-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:major-fareast;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:major-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:major-bidi;
color:#4F81BD;
mso-themecolor:accent1;
font-weight:bold;}
p.MsoCaption, li.MsoCaption, div.MsoCaption
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-next:Normal;
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";
mso-fareast-font-family:"Times New Roman";
font-weight:bold;}
p.MsoEnvelopeReturn, li.MsoEnvelopeReturn, div.MsoEnvelopeReturn
{mso-style-noshow:yes;
mso-style-priority:99;
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman","serif";
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:major-fareast;}
a:link, span.MsoHyperlink
{mso-style-unhide:no;
color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-noshow:yes;
mso-style-priority:99;
color:purple;
mso-themecolor:followedhyperlink;
text-decoration:underline;
text-underline:single;}
p
{mso-style-unhide:no;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman","serif";
mso-fareast-font-family:"Times New Roman";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-noshow:yes;
mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-font-family:"Times New Roman";}
span.Heading1Char
{mso-style-name:"Heading 1 Char";
mso-style-unhide:no;
mso-style-locked:yes;
mso-style-link:"Heading 1";
mso-ansi-font-size:16.0pt;
mso-bidi-font-size:16.0pt;
font-family:"MS Mincho";
mso-fareast-font-family:"MS Mincho";
mso-bidi-font-family:Arial;
mso-font-kerning:16.0pt;
mso-fareast-language:JA;
font-weight:bold;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-unhide:no;
mso-style-locked:yes;
mso-style-link:"Balloon Text";
mso-ansi-font-size:8.0pt;
mso-bidi-font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-ascii-font-family:Tahoma;
mso-fareast-font-family:"Times New Roman";
mso-hansi-font-family:Tahoma;
mso-bidi-font-family:Tahoma;}
span.Heading2Char
{mso-style-name:"Heading 2 Char";
mso-style-priority:9;
mso-style-unhide:no;
mso-style-locked:yes;
mso-style-link:"Heading 2";
mso-ansi-font-size:13.0pt;
mso-bidi-font-size:13.0pt;
font-family:"Cambria","serif";
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:major-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:major-fareast;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:major-latin;
color:#4F81BD;
mso-themecolor:accent1;
font-weight:bold;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Arial;
mso-fareast-font-family:Calibri;
mso-fareast-theme-font:minor-latin;
mso-hansi-font-family:Arial;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:major-bidi;}
.MsoPapDefault
{mso-style-type:export-only;
margin-bottom:10.0pt;
line-height:115%;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Arial","sans-serif";
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:major-bidi;}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple style='tab-interval:36.0pt'>
<div class=Section1>
<p class=MsoNormal><b><span style='font-family:"Arial","sans-serif"'>Lesson
Plan Title:</span></b><span style='font-family:"Arial","sans-serif"'> How to Perform Numeric SQL Injection <o:p></o:p></span></p>
<p class=MsoNormal><b><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></b></p>
<p class=MsoNormal><b><span style='font-family:"Arial","sans-serif"'>Concept /
Topic To Teach:</span></b><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p>
<!-- Start Instructions -->
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>
SQL injection attacks represent a serious threat to any database-driven site. The methods behind an attack are easy to learn and the damage caused can range from considerable to complete system compromise. Despite these risks, an incredible number of systems on the internet are susceptible to this form of attack.
Not only is it a threat easily instigated, it is also a threat that, with a little common-sense and forethought, can easily be prevented.
It is always good practice to sanitize all input data, especially data that will used in OS command, scripts, and database queries, even if the threat of SQL injection has been prevented in some other manner.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><b><span style='font-family:"Arial","sans-serif"'>General
Goal(s):</span></b><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>
The form below allows a user to view weather data. Try to inject an SQL string that results in all the weather data being displayed.
<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
style='font-family:"Arial","sans-serif"'>Solution:<o:p></o:p></span></b></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>The
application is taking the input from the select box and inserting it at the end of a pre-formed
SQL command.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Compound SQL
statements can be made by joining multiple tests with keywords like AND and OR.
Try appending a SQL statement that always resolves to true.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>This is the
query: SELECT * FROM weather_data WHERE station = 101<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Intercept the post request with WebScarab and replace 101 with 101 or 1=1!<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><o:p> </o:p></span></p>
<img src = "SqlNumericInjection_files/numericinjection.png" width=350px>
<p class=MsoCaption>Figure <!--[if supportFields]><span style='mso-element:
field-begin'></span><span style='mso-spacerun:yes'> </span>SEQ Figure \* ARABIC
<span style='mso-element:field-separator'></span><![endif]--><span
style='mso-no-proof:yes'>1</span><!--[if supportFields]><span style='mso-element:
field-end'></span><![endif]--> Intercepted Request with WebScarab<span style='font-family:
"Arial","sans-serif"'><o:p></o:p></span></p>
<br/>
<br/>
<p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>As the SQL Statement is true for every station you get
a list of all stations:<o:p></o:p></span></p>
<img src = "SqlNumericInjection_files/numericinjection_solved.png" width=350px>
<p class=MsoCaption>Figure <!--[if supportFields]><span style='mso-element:
field-begin'></span><span style='mso-spacerun:yes'> </span>SEQ Figure \* ARABIC
<span style='mso-element:field-separator'></span><![endif]--><span
style='mso-no-proof:yes'>2</span><!--[if supportFields]><span style='mso-element:
field-end'></span><![endif]--> All stations are visible<span style='font-family:
"Arial","sans-serif"'><o:p></o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<table align='RIGHT' cellspacing='0' width='90%' border='0' cellpadding='0'>
<tr>
<td valign='MIDDLE' width='100%' align='RIGHT class=MsoNormal' style='font-family:"Arial","sans-serif"'>
Solution by Erwin Geirnaert
</td>
<td valign='MIDDLE' align='RIGHT'><img hspace='0' vspace='0' border='0' alt='ZION SECURITY' src='images/logos/zionsecurity.gif'></td>
</tr>
</table>
</body>
</html>
| {
"content_hash": "ff767ff0a6335b72ed951fa8753b743c",
"timestamp": "",
"source": "github",
"line_count": 682,
"max_line_length": 315,
"avg_line_length": 44.605571847507335,
"alnum_prop": 0.7200946714440682,
"repo_name": "RIGS-IT/sonar-xanitizer",
"id": "d53f2de88823cbb1b2fb17d2738d31e2ecede520",
"size": "30421",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/resources/webgoat/plugin_extracted/sql-numeric-injection-1.0/plugin/SqlNumericInjection/lessonSolutions/en/SqlNumericInjection.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6851"
},
{
"name": "HTML",
"bytes": "1546960"
},
{
"name": "Java",
"bytes": "1755101"
},
{
"name": "JavaScript",
"bytes": "14202"
},
{
"name": "TSQL",
"bytes": "5327"
}
],
"symlink_target": ""
} |
/**
* @fileoverview Utility methods to deal with CSS3 transitions
* programmatically.
*/
goog.provide('goog.style.transition');
goog.provide('goog.style.transition.Css3Property');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.dom.safe');
goog.require('goog.dom.vendor');
goog.require('goog.functions');
goog.require('goog.html.SafeHtml');
goog.require('goog.style');
goog.require('goog.userAgent');
/**
* A typedef to represent a CSS3 transition property. Duration and delay
* are both in seconds. Timing is CSS3 timing function string, such as
* 'easein', 'linear'.
*
* Alternatively, specifying string in the form of '[property] [duration]
* [timing] [delay]' as specified in CSS3 transition is fine too.
*
* @typedef { {
* property: string,
* duration: number,
* timing: string,
* delay: number
* } | string }
*/
goog.style.transition.Css3Property;
/**
* Sets the element CSS3 transition to properties.
* @param {Element} element The element to set transition on.
* @param {goog.style.transition.Css3Property|
* Array<goog.style.transition.Css3Property>} properties A single CSS3
* transition property or array of properties.
* @suppress {strictMissingProperties} Part of the go/strict_warnings_migration
*/
goog.style.transition.set = function(element, properties) {
'use strict';
if (!Array.isArray(properties)) {
properties = [properties];
}
goog.asserts.assert(
properties.length > 0, 'At least one Css3Property should be specified.');
var values = properties.map(function(p) {
'use strict';
if (typeof p === 'string') {
return p;
} else {
goog.asserts.assertObject(p, 'Expected css3 property to be an object.');
var propString =
p.property + ' ' + p.duration + 's ' + p.timing + ' ' + p.delay + 's';
goog.asserts.assert(
p.property && typeof p.duration === 'number' && p.timing &&
typeof p.delay === 'number',
'Unexpected css3 property value: %s', propString);
return propString;
}
});
goog.style.transition.setPropertyValue_(element, values.join(','));
};
/**
* Removes any programmatically-added CSS3 transition in the given element.
* @param {Element} element The element to remove transition from.
*/
goog.style.transition.removeAll = function(element) {
'use strict';
goog.style.transition.setPropertyValue_(element, '');
};
/**
* @return {boolean} Whether CSS3 transition is supported.
*/
goog.style.transition.isSupported = goog.functions.cacheReturnValue(function() {
'use strict';
// Since IE would allow any attribute, we need to explicitly check the
// browser version here instead.
if (goog.userAgent.IE) {
return true;
}
// We create a test element with style=-vendor-transition
// We then detect whether those style properties are recognized and
// available from js.
var el = goog.dom.createElement(goog.dom.TagName.DIV);
var transition = 'opacity 1s linear';
var vendorPrefix = goog.dom.vendor.getVendorPrefix();
var style = {'transition': transition};
if (vendorPrefix) {
style[vendorPrefix + '-transition'] = transition;
}
goog.dom.safe.setInnerHtml(
el, goog.html.SafeHtml.create('div', {'style': style}));
var testElement = /** @type {Element} */ (el.firstChild);
goog.asserts.assert(testElement.nodeType == Node.ELEMENT_NODE);
return goog.style.getStyle(testElement, 'transition') != '';
});
/**
* Sets CSS3 transition property value to the given value.
* @param {Element} element The element to set transition on.
* @param {string} transitionValue The CSS3 transition property value.
* @private
*/
goog.style.transition.setPropertyValue_ = function(element, transitionValue) {
'use strict';
goog.style.setStyle(element, 'transition', transitionValue);
};
| {
"content_hash": "060d7bb1ba1b794b37acd14d401b238a",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 80,
"avg_line_length": 31.104,
"alnum_prop": 0.6890432098765432,
"repo_name": "google/closure-library",
"id": "be2e7ce48bfb73a697513378edf672e5bf9423b8",
"size": "3988",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "closure/goog/style/transition.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "101727"
},
{
"name": "Emacs Lisp",
"bytes": "2400"
},
{
"name": "HTML",
"bytes": "799248"
},
{
"name": "JavaScript",
"bytes": "23653511"
},
{
"name": "Python",
"bytes": "22087"
},
{
"name": "Shell",
"bytes": "10789"
},
{
"name": "Starlark",
"bytes": "269483"
},
{
"name": "TypeScript",
"bytes": "38770"
}
],
"symlink_target": ""
} |
__author__ = 'e.lyzlov'
from model.group import Group
testdata = [
Group(name="name1", header="header1", footer="footer1"),
Group(name="name2", header="header2", footer="footer2")
]
| {
"content_hash": "869b0d307d23d1aa2adb9aa1a3a24c0b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 60,
"avg_line_length": 27.285714285714285,
"alnum_prop": 0.6596858638743456,
"repo_name": "Dananas732/python",
"id": "b085da51bccc0e1a5617fdc03508e121a771905f",
"size": "191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "data/groups.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "39165"
}
],
"symlink_target": ""
} |
package org.encuestame.persistence.exception;
/**
* EnMe Domain not found Exception.
* @author Picado, Juan juanATencuestame.org
* @since Oct 9, 2010 1:27:09 PM
* @version $Id:$
*/
public class EnMeNoResultsFoundException extends EnMeExpcetion{
/**
* Serial.
*/
private static final long serialVersionUID = -120650572833612949L;
public EnMeNoResultsFoundException() {
super();
}
public EnMeNoResultsFoundException(String message, Throwable cause) {
super(message, cause);
}
public EnMeNoResultsFoundException(String message) {
super(message);
}
public EnMeNoResultsFoundException(Throwable cause) {
super(cause);
}
}
| {
"content_hash": "6eb905714095e3884d5a5b8654240c1e",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 73,
"avg_line_length": 22.21875,
"alnum_prop": 0.6779184247538678,
"repo_name": "cristiani/encuestame",
"id": "f9dcc852186d7dd8ebd83df526a10eaa89873c55",
"size": "1481",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "enme-persistence/enme-model/src/main/java/org/encuestame/persistence/exception/EnMeNoResultsFoundException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "9772228"
},
{
"name": "HTML",
"bytes": "552"
},
{
"name": "Java",
"bytes": "4752329"
},
{
"name": "JavaScript",
"bytes": "7194351"
},
{
"name": "Ruby",
"bytes": "1012"
},
{
"name": "Shell",
"bytes": "4346"
}
],
"symlink_target": ""
} |
layout: "default"
---
Test for the issue [#88](https://github.com/spress/Spress/issues/88).
| {
"content_hash": "f418f23dcc69a87feea94cd02c95a5cf",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 69,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.6736842105263158,
"repo_name": "spress/Spress",
"id": "a5fe41d1bf7a020cc5c6e32d0ada85cef12c2fe0",
"size": "100",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Core/Tests/fixtures/project/src/content/posts/2016-02-02-spress-2.1.1-released.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "134"
},
{
"name": "CSS",
"bytes": "86"
},
{
"name": "HTML",
"bytes": "63413"
},
{
"name": "PHP",
"bytes": "636972"
}
],
"symlink_target": ""
} |
LEVEL := ../..
LIBRARYNAME := LLVMgold
LINK_LIBS_IN_SHARED := 1
SHARED_LIBRARY := 1
LOADABLE_MODULE := 1
EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/gold.exports
# Include this here so we can get the configuration of the targets
# that have been configured for construction. We have to do this
# early so we can set up LINK_COMPONENTS before including Makefile.rules
include $(LEVEL)/Makefile.config
LINK_COMPONENTS := $(TARGETS_TO_BUILD) Linker BitWriter IPO
# Because off_t is used in the public API, the largefile parts are required for
# ABI compatibility.
CXXFLAGS += -I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
LDFLAGS += -L$(SharedLibDir)/$(SharedPrefix)
include $(LEVEL)/Makefile.common
| {
"content_hash": "ad7ea5143bc46ff40009f4e1d8390ecd",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 79,
"avg_line_length": 32.59090909090909,
"alnum_prop": 0.7475592747559274,
"repo_name": "henfredemars/Fork-Lang",
"id": "aa006b0048fc7de9a759de6058bfc56ed4fc327e",
"size": "1055",
"binary": false,
"copies": "26",
"ref": "refs/heads/master",
"path": "llvm/tools/gold/Makefile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "10354229"
},
{
"name": "Batchfile",
"bytes": "13322"
},
{
"name": "C",
"bytes": "2489216"
},
{
"name": "C++",
"bytes": "48814710"
},
{
"name": "CMake",
"bytes": "296748"
},
{
"name": "CSS",
"bytes": "3339"
},
{
"name": "Emacs Lisp",
"bytes": "9440"
},
{
"name": "Go",
"bytes": "133302"
},
{
"name": "Groff",
"bytes": "24328"
},
{
"name": "HTML",
"bytes": "145927"
},
{
"name": "LLVM",
"bytes": "38718831"
},
{
"name": "Lex",
"bytes": "3095"
},
{
"name": "Makefile",
"bytes": "352750"
},
{
"name": "Mirah",
"bytes": "202593"
},
{
"name": "OCaml",
"bytes": "401694"
},
{
"name": "Objective-C",
"bytes": "392655"
},
{
"name": "Perl",
"bytes": "27878"
},
{
"name": "Python",
"bytes": "503521"
},
{
"name": "Shell",
"bytes": "827560"
},
{
"name": "SourcePawn",
"bytes": "2461"
},
{
"name": "Standard ML",
"bytes": "2841"
},
{
"name": "VimL",
"bytes": "16468"
},
{
"name": "Yacc",
"bytes": "12546"
}
],
"symlink_target": ""
} |
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.codeInsight.daemon.quickFix.ExternalLibraryResolver;
import com.intellij.openapi.module.LanguageLevelUtil;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.ExternalLibraryDescriptor;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.util.ThreeState;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
public class JetBrainsAnnotationsExternalLibraryResolver extends ExternalLibraryResolver {
/**
* Specifies version of jetbrains-annotations library which will be selected by default when user applies a quick fix on an unresolved annotation reference.
* It must be equal to version of jetbrains-annotations library which is bundled with the IDE, the both should refer to version of the library
* which is fully supported by the current state of IDE's inspections.
*/
private static final String VERSION = "23.0.0";
private static final ExternalLibraryDescriptor JAVA5 = new ExternalLibraryDescriptor("org.jetbrains", "annotations-java5",
null, null, VERSION);
private static final ExternalLibraryDescriptor JAVA8 = new ExternalLibraryDescriptor("org.jetbrains", "annotations",
null, null, VERSION);
@Nullable
@Override
public ExternalClassResolveResult resolveClass(@NotNull String shortClassName, @NotNull ThreeState isAnnotation, @NotNull Module contextModule) {
if (AnnotationUtil.isJetbrainsAnnotation(shortClassName)) {
ExternalLibraryDescriptor libraryDescriptor = getAnnotationsLibraryDescriptor(contextModule);
return new ExternalClassResolveResult("org.jetbrains.annotations." + shortClassName, libraryDescriptor);
}
return null;
}
@NotNull
public static ExternalLibraryDescriptor getAnnotationsLibraryDescriptor(@NotNull Module contextModule) {
boolean java8 = LanguageLevelUtil.getEffectiveLanguageLevel(contextModule).isAtLeast(LanguageLevel.JDK_1_8);
return java8 ? JAVA8 : JAVA5;
}
@TestOnly
public static String getVersion() {
return VERSION;
}
}
| {
"content_hash": "632101d727d93d4ed6cbfed4e19a0d61",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 158,
"avg_line_length": 50.212765957446805,
"alnum_prop": 0.7470338983050847,
"repo_name": "JetBrains/intellij-community",
"id": "c0fe453f71bcf2c3c0a96990b53f331e8ce21324",
"size": "2960",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/JetBrainsAnnotationsExternalLibraryResolver.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import json
from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
import webauthn
from webauthn import options_to_json, base64url_to_bytes
from webauthn.helpers.structs import PublicKeyCredentialDescriptor, AuthenticationCredential
from webauthn.helpers.exceptions import InvalidAuthenticationResponse
class OriginMixin(object):
def get_origin(self):
return '{scheme}://{host}'.format(
scheme=self.request.scheme,
host=self.request.get_host(),
)
def get_rp_id(request):
return request.get_host().strip(':{}'.format(request.get_port()))
class SecondFactorForm(forms.Form):
def __init__(self, *args, **kwargs):
self.user = kwargs.pop('user')
self.request = kwargs.pop('request')
self.appId = kwargs.pop('appId')
return super(SecondFactorForm, self).__init__(*args, **kwargs)
class KeyResponseForm(SecondFactorForm, OriginMixin):
response = forms.CharField()
def __init__(self, *args, **kwargs):
super(KeyResponseForm, self).__init__(*args, **kwargs)
if self.data:
self.sign_request = self.request.session['u2f_sign_request']
else:
options = webauthn.generate_authentication_options(
rp_id=get_rp_id(self.request),
allow_credentials=[
PublicKeyCredentialDescriptor(id=base64url_to_bytes(x.key_handle))
for x in self.user.u2f_keys.all()
]
)
options = options_to_json(options)
options = json.loads(options)
options['extensions'] = {
'appid': self.get_origin()
}
options = {'publicKey': options}
self.sign_request = options
self.request.session['u2f_sign_request'] = options
self.request.session['expected_origin'] = self.get_origin()
def validate_second_factor(self):
response = self.cleaned_data['response']
try:
data = self.request.session['u2f_sign_request']['publicKey']
json_data = json.loads(response)
key = self.user.u2f_keys.get(key_handle=json_data['id'])
expected_rp_id = data['rpId']
# use appid as expected_rp_id if appid extension is True
# https://github.com/duo-labs/py_webauthn/issues/116#issuecomment-1010385763
if json_data['clientExtensionResults'].get('appid', False):
expected_rp_id = key.app_id
verification = webauthn.verify_authentication_response(
credential=AuthenticationCredential.parse_raw(response),
expected_challenge=base64url_to_bytes(data['challenge']),
expected_rp_id=expected_rp_id,
expected_origin=self.request.session['expected_origin'],
credential_public_key=base64url_to_bytes(key.public_key),
credential_current_sign_count=0,
require_user_verification=False,
)
# TODO: store sign_count and verify it's increasing
key.last_used_at = timezone.now()
key.save()
del self.request.session['u2f_sign_request']
del self.request.session['expected_origin']
return True
except (ValueError, InvalidAuthenticationResponse) as e:
self.add_error('__all__', 'Validation failed -- bad signature.')
except ObjectDoesNotExist:
self.add_error('__all__', 'Validation failed')
return False
class KeyRegistrationForm(SecondFactorForm):
response = forms.CharField()
class BackupCodeForm(SecondFactorForm):
INVALID_ERROR_MESSAGE = _("That is not a valid backup code.")
code = forms.CharField(label=_("Code"), widget=forms.TextInput(attrs={'autocomplete': 'off'}))
def validate_second_factor(self):
count, _ = self.user.backup_codes.filter(code=self.cleaned_data['code']).delete()
if count == 0:
self.add_error('code', self.INVALID_ERROR_MESSAGE)
return False
elif count == 1:
return True
else:
assert False, \
"Impossible, there should never be more than one object with the same code."
class TOTPForm(SecondFactorForm):
INVALID_ERROR_MESSAGE = _("That token is invalid.")
token = forms.CharField(
min_length=6,
max_length=6,
label=_("Token"),
widget=forms.TextInput(attrs={'autocomplete': 'off'})
)
def validate_second_factor(self):
for device in self.user.totp_devices.all():
if device.validate_token(self.cleaned_data['token']):
device.last_used_at = timezone.now()
device.save()
return True
self.add_error('token', self.INVALID_ERROR_MESSAGE)
return False
| {
"content_hash": "38b454f1426fa4e770e3ee3a1ba11ce3",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 98,
"avg_line_length": 38.01526717557252,
"alnum_prop": 0.6124497991967871,
"repo_name": "gavinwahl/django-u2f",
"id": "09bc56c83d4886ccf057655b468956808c9b3bb1",
"size": "4980",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "django_u2f/forms.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "HTML",
"bytes": "6377"
},
{
"name": "JavaScript",
"bytes": "3419"
},
{
"name": "Python",
"bytes": "55502"
},
{
"name": "Shell",
"bytes": "206"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>smt-check: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.13.2 / smt-check - 1.0.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
smt-check
<small>
1.0.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-03-02 03:01:05 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-02 03:01:05 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "gmalecha@gmail.com"
homepage: "https://github.com/gmalecha/coq-smt-check"
bug-reports: "https://github.com/gmalecha/coq-smt-check/issues"
license: "MIT"
build: [
[make "-j%{jobs}%"]
]
install: [make "install"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
"coq-plugin-utils" {>= "1.1.0" & < "2.0.0"}
]
tags: [
"logpath:SMT"
]
synopsis: "Invoke SMT solvers to check goals"
authors: "Gregory Malecha"
url {
src: "https://github.com/gmalecha/coq-smt-check/archive/v1.0.0.tar.gz"
checksum: "md5=29a171c5c3d3486b87968e3cd512a458"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-smt-check.1.0.0 coq.8.13.2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.2).
The following dependencies couldn't be met:
- coq-smt-check -> coq < 8.6~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-smt-check.1.0.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "9178b2ef1b8158ae301106f29dc25390",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 159,
"avg_line_length": 40.00613496932515,
"alnum_prop": 0.5252261923017942,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "be0723b4a777dfec5092e86009c21c44c7a0f22e",
"size": "6546",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.13.2/smt-check/1.0.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
/*jshint globalstrict:false, strict:false, maxlen: 500 */
/*global assertEqual, assertTrue, assertFalse, assertNotEqual, assertUndefined, AQL_EXPLAIN, AQL_EXECUTE */
////////////////////////////////////////////////////////////////////////////////
/// @brief tests for optimizer rules
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Jan Steemann
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
var jsunity = require("jsunity");
var helper = require("@arangodb/aql-helper");
var db = require("@arangodb").db;
var removeAlwaysOnClusterRules = helper.removeAlwaysOnClusterRules;
var removeClusterNodes = helper.removeClusterNodes;
////////////////////////////////////////////////////////////////////////////////
/// @brief test suite
////////////////////////////////////////////////////////////////////////////////
function optimizerRuleTestSuite () {
var ruleName = "remove-sort-rand";
// various choices to control the optimizer:
var paramNone = { optimizer: { rules: [ "-all" ] } };
var paramEnabled = { optimizer: { rules: [ "-all", "+" + ruleName, "+remove-unnecessary-calculations-2" ] } };
var c;
return {
////////////////////////////////////////////////////////////////////////////////
/// @brief set up
////////////////////////////////////////////////////////////////////////////////
setUp : function () {
db._drop("UnitTestsCollection");
c = db._create("UnitTestsCollection");
for (var i = 0; i < 1010; ++i) {
c.save({ value: i });
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief tear down
////////////////////////////////////////////////////////////////////////////////
tearDown : function () {
db._drop("UnitTestsCollection");
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test that rule has no effect when explicitly disabled
////////////////////////////////////////////////////////////////////////////////
testRuleDisabled : function () {
var queries = [
"FOR i IN " + c.name() + " SORT RAND() RETURN i",
"FOR i IN " + c.name() + " SORT RAND() LIMIT 1 RETURN i"
];
queries.forEach(function(query) {
var result = AQL_EXPLAIN(query, { }, paramNone);
assertEqual([ ], removeAlwaysOnClusterRules(result.plan.rules));
});
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test that rule has no effect
////////////////////////////////////////////////////////////////////////////////
testRuleNoEffect : function () {
c.ensureSkiplist("value");
var queries = [
"FOR i IN 1..10 SORT RAND() RETURN i", // no collection
"FOR i IN " + c.name() + " SORT i.value, RAND() RETURN i", // more than one sort criterion
"FOR i IN " + c.name() + " SORT RAND(), i.value RETURN i", // more than one sort criterion
"FOR i IN " + c.name() + " FOR j IN " + c.name() + " SORT RAND() RETURN i", // more than one collection
"FOR i IN " + c.name() + " LET a = FAIL(1) SORT RAND() RETURN [ i, a ]", // may throw
"FOR i IN " + c.name() + " FILTER i.value > 10 SORT RAND() RETURN i", // uses an IndexNode
"FOR i IN " + c.name() + " FILTER i.what == 2 SORT RAND() RETURN i", // contains FilterNode
"FOR i IN " + c.name() + " COLLECT v = i.value SORT RAND() RETURN v", // contains CollectNode
"FOR i IN " + c.name() + " LET x = (FOR j IN 1..1 RETURN i.value) SORT RAND() RETURN x" // contains SubqueryNode
];
queries.forEach(function(query) {
var result = AQL_EXPLAIN(query, { }, paramEnabled);
assertEqual(-1, result.plan.rules.indexOf(ruleName), query);
});
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test that rule has an effect
////////////////////////////////////////////////////////////////////////////////
testRuleHasEffect : function () {
c.ensureSkiplist("value");
var queries = [
"FOR i IN " + c.name() + " SORT RAND() RETURN i",
"FOR i IN " + c.name() + " SORT RAND() ASC RETURN i",
"FOR i IN " + c.name() + " SORT RAND() DESC RETURN i",
"FOR i IN " + c.name() + " SORT RAND() LIMIT 2 RETURN i",
"FOR i IN " + c.name() + " LIMIT 1 SORT RAND() RETURN i",
"FOR i IN " + c.name() + " LET x = i.value + 1 SORT RAND() RETURN x",
"FOR i IN " + c.name() + " SORT RAND() FILTER i.value > 10 RETURN i", // does not use an IndexNode
];
queries.forEach(function(query) {
var result = AQL_EXPLAIN(query, { }, paramEnabled);
assertNotEqual(-1, result.plan.rules.indexOf(ruleName), query);
var collectionNode = result.plan.nodes.map(function(node) { return node.type; }).indexOf("EnumerateCollectionNode");
assertEqual("EnumerateCollectionNode", result.plan.nodes[collectionNode].type);
assertTrue(result.plan.nodes[collectionNode].random); // check for random iteration flag
});
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test generated plans
////////////////////////////////////////////////////////////////////////////////
testPlans : function () {
var plans = [
[ "FOR i IN " + c.name() + " SORT RAND() RETURN i", [ "SingletonNode", "EnumerateCollectionNode", "ReturnNode" ] ],
[ "FOR i IN " + c.name() + " LET x = i.value + 1 SORT RAND() RETURN x", [ "SingletonNode", "EnumerateCollectionNode", "CalculationNode", "ReturnNode" ] ],
[ "FOR i IN " + c.name() + " SORT RAND() LIMIT 1 RETURN i", [ "SingletonNode", "EnumerateCollectionNode", "LimitNode", "ReturnNode" ] ],
[ "FOR i IN " + c.name() + " LIMIT 1 SORT RAND() RETURN i", [ "SingletonNode", "EnumerateCollectionNode", "LimitNode", "ReturnNode" ] ]
];
plans.forEach(function(plan) {
var result = AQL_EXPLAIN(plan[0], { }, paramEnabled);
assertNotEqual(-1, result.plan.rules.indexOf(ruleName), plan[0]);
assertEqual(plan[1], removeClusterNodes(helper.getCompactPlan(result).map(function(node) { return node.type; })), plan[0]);
var collectionNode = result.plan.nodes.map(function(node) { return node.type; }).indexOf("EnumerateCollectionNode");
assertEqual("EnumerateCollectionNode", result.plan.nodes[collectionNode].type);
assertTrue(result.plan.nodes[collectionNode].random); // check for random iteration flag
});
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test results
////////////////////////////////////////////////////////////////////////////////
testResultsNested : function () {
var query = "FOR i IN 1..2 FOR j IN " + c.name() + " SORT RAND() RETURN j";
var result = AQL_EXPLAIN(query, { }, paramEnabled);
assertEqual(-1, result.plan.rules.indexOf(ruleName), query);
result = AQL_EXECUTE(query).json;
assertEqual(1010 * 2, result.length);
// assert all random results are unique
var hasSeen = { };
for (var i = 0; i < result.length; ++i) {
var key = result[i]._key;
if (hasSeen.hasOwnProperty(key)) {
assertEqual(1, hasSeen[key]);
hasSeen[key] = 2;
}
else {
assertUndefined(hasSeen[key]);
hasSeen[key] = 1;
}
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test results
////////////////////////////////////////////////////////////////////////////////
testResultsNestedWithLimit : function () {
var query = "FOR i IN 1..2 FOR j IN " + c.name() + " SORT RAND() LIMIT 1020 RETURN j";
var result = AQL_EXPLAIN(query, { }, paramEnabled);
assertEqual(-1, result.plan.rules.indexOf(ruleName), query);
result = AQL_EXECUTE(query).json;
assertEqual(1020, result.length);
// assert all random results are unique
var hasSeen = { };
for (var i = 0; i < result.length; ++i) {
var key = result[i]._key;
if (hasSeen.hasOwnProperty(key)) {
assertEqual(1, hasSeen[key]);
hasSeen[key] = 2;
}
else {
assertUndefined(hasSeen[key]);
hasSeen[key] = 1;
}
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test results
////////////////////////////////////////////////////////////////////////////////
testResultsMustNotHaveDuplicates : function () {
var query = "FOR j IN " + c.name() + " SORT RAND() RETURN j";
var result = AQL_EXPLAIN(query, { }, paramEnabled);
assertNotEqual(-1, result.plan.rules.indexOf(ruleName), query);
result = AQL_EXECUTE(query).json;
assertEqual(1010, result.length);
// assert all random results are unique
var hasSeen = { };
for (var i = 0; i < result.length; ++i) {
var key = result[i]._key;
assertFalse(hasSeen.hasOwnProperty(key));
hasSeen[key] = 1;
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test results
////////////////////////////////////////////////////////////////////////////////
testResultsDescMustNotHaveDuplicates : function () {
var query = "FOR j IN " + c.name() + " SORT RAND() DESC RETURN j";
var result = AQL_EXPLAIN(query, { }, paramEnabled);
assertNotEqual(-1, result.plan.rules.indexOf(ruleName), query);
result = AQL_EXECUTE(query).json;
assertEqual(1010, result.length);
// assert all random results are unique
var hasSeen = { };
for (var i = 0; i < result.length; ++i) {
var key = result[i]._key;
assertFalse(hasSeen.hasOwnProperty(key));
hasSeen[key] = 1;
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test results
////////////////////////////////////////////////////////////////////////////////
testResultsLimit : function () {
var query = "FOR j IN " + c.name() + " SORT RAND() LIMIT 1001 RETURN j";
var result = AQL_EXPLAIN(query, { }, paramEnabled);
assertNotEqual(-1, result.plan.rules.indexOf(ruleName), query);
result = AQL_EXECUTE(query).json;
assertEqual(1001, result.length);
// assert all random results are unique
var hasSeen = { };
for (var i = 0; i < result.length; ++i) {
var key = result[i]._key;
assertFalse(hasSeen.hasOwnProperty(key));
hasSeen[key] = 1;
}
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test results
////////////////////////////////////////////////////////////////////////////////
testSubqueryResults : function () {
var result = AQL_EXECUTE("FOR i IN 1..5 LET values = (FOR j IN " + c.name() + " SORT RAND() RETURN j) RETURN values").json;
assertEqual(5, result.length);
// assert all random results are unique
var hasSeen = { };
for (var i = 0; i < result.length; ++i) {
assertEqual(1010, result[i].length);
// each subquery result must be different
var key = JSON.stringify(result[i]);
assertFalse(hasSeen.hasOwnProperty(key));
hasSeen[key] = 1;
}
}
};
}
////////////////////////////////////////////////////////////////////////////////
/// @brief executes the test suite
////////////////////////////////////////////////////////////////////////////////
jsunity.run(optimizerRuleTestSuite);
return jsunity.done();
| {
"content_hash": "ad6465518d4f550d2344fafb3c659db6",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 162,
"avg_line_length": 40.586319218241044,
"alnum_prop": 0.4822632423756019,
"repo_name": "joerg84/arangodb",
"id": "faebd5887b1a6a8a2426c5331ed9899bf8dcc86b",
"size": "12460",
"binary": false,
"copies": "4",
"ref": "refs/heads/devel",
"path": "js/server/tests/aql/aql-optimizer-rule-remove-sort-rand-mmfiles.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ada",
"bytes": "89079"
},
{
"name": "Assembly",
"bytes": "399979"
},
{
"name": "Awk",
"bytes": "7502"
},
{
"name": "Batchfile",
"bytes": "62496"
},
{
"name": "C",
"bytes": "8969003"
},
{
"name": "C#",
"bytes": "96431"
},
{
"name": "C++",
"bytes": "276709880"
},
{
"name": "CMake",
"bytes": "647521"
},
{
"name": "CSS",
"bytes": "582111"
},
{
"name": "CWeb",
"bytes": "174166"
},
{
"name": "Cuda",
"bytes": "52444"
},
{
"name": "DIGITAL Command Language",
"bytes": "259402"
},
{
"name": "Emacs Lisp",
"bytes": "14637"
},
{
"name": "Fortran",
"bytes": "1856"
},
{
"name": "Gherkin",
"bytes": "31082"
},
{
"name": "Groovy",
"bytes": "131"
},
{
"name": "HTML",
"bytes": "2415147"
},
{
"name": "Java",
"bytes": "1048556"
},
{
"name": "JavaScript",
"bytes": "53976140"
},
{
"name": "LLVM",
"bytes": "24169"
},
{
"name": "Lex",
"bytes": "1231"
},
{
"name": "Lua",
"bytes": "17899"
},
{
"name": "M4",
"bytes": "658700"
},
{
"name": "Makefile",
"bytes": "522586"
},
{
"name": "Max",
"bytes": "36857"
},
{
"name": "Module Management System",
"bytes": "1545"
},
{
"name": "NSIS",
"bytes": "40920"
},
{
"name": "Objective-C",
"bytes": "122447"
},
{
"name": "Objective-C++",
"bytes": "2503"
},
{
"name": "PHP",
"bytes": "111847"
},
{
"name": "Pascal",
"bytes": "150599"
},
{
"name": "Perl",
"bytes": "915273"
},
{
"name": "Perl 6",
"bytes": "17347"
},
{
"name": "PowerShell",
"bytes": "15315"
},
{
"name": "Python",
"bytes": "4536513"
},
{
"name": "QMake",
"bytes": "16692"
},
{
"name": "R",
"bytes": "5123"
},
{
"name": "Rebol",
"bytes": "354"
},
{
"name": "Roff",
"bytes": "1089418"
},
{
"name": "Ruby",
"bytes": "1045468"
},
{
"name": "SAS",
"bytes": "1847"
},
{
"name": "Scheme",
"bytes": "10604"
},
{
"name": "Shell",
"bytes": "492324"
},
{
"name": "Swift",
"bytes": "116"
},
{
"name": "Tcl",
"bytes": "1172"
},
{
"name": "TeX",
"bytes": "32117"
},
{
"name": "Visual Basic",
"bytes": "11568"
},
{
"name": "XSLT",
"bytes": "567028"
},
{
"name": "Yacc",
"bytes": "53072"
}
],
"symlink_target": ""
} |
using System;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager;
namespace Azure.ResourceManager.DevCenter
{
/// <summary>
/// A Class representing an Image along with the instance operations that can be performed on it.
/// If you have a <see cref="ResourceIdentifier" /> you can construct an <see cref="ImageResource" />
/// from an instance of <see cref="ArmClient" /> using the GetImageResource method.
/// Otherwise you can get one from its parent resource <see cref="GalleryResource" /> using the GetImage method.
/// </summary>
public partial class ImageResource : ArmResource
{
/// <summary> Generate the resource identifier of a <see cref="ImageResource"/> instance. </summary>
public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string devCenterName, string galleryName, string imageName)
{
var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}";
return new ResourceIdentifier(resourceId);
}
private readonly ClientDiagnostics _imageClientDiagnostics;
private readonly ImagesRestOperations _imageRestClient;
private readonly ImageData _data;
/// <summary> Initializes a new instance of the <see cref="ImageResource"/> class for mocking. </summary>
protected ImageResource()
{
}
/// <summary> Initializes a new instance of the <see cref = "ImageResource"/> class. </summary>
/// <param name="client"> The client parameters to use in these operations. </param>
/// <param name="data"> The resource that is the target of operations. </param>
internal ImageResource(ArmClient client, ImageData data) : this(client, data.Id)
{
HasData = true;
_data = data;
}
/// <summary> Initializes a new instance of the <see cref="ImageResource"/> class. </summary>
/// <param name="client"> The client parameters to use in these operations. </param>
/// <param name="id"> The identifier of the resource that is the target of operations. </param>
internal ImageResource(ArmClient client, ResourceIdentifier id) : base(client, id)
{
_imageClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DevCenter", ResourceType.Namespace, Diagnostics);
TryGetApiVersion(ResourceType, out string imageApiVersion);
_imageRestClient = new ImagesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, imageApiVersion);
#if DEBUG
ValidateResourceId(Id);
#endif
}
/// <summary> Gets the resource type for the operations. </summary>
public static readonly ResourceType ResourceType = "Microsoft.DevCenter/devcenters/galleries/images";
/// <summary> Gets whether or not the current instance has data. </summary>
public virtual bool HasData { get; }
/// <summary> Gets the data representing this Feature. </summary>
/// <exception cref="InvalidOperationException"> Throws if there is no data loaded in the current instance. </exception>
public virtual ImageData Data
{
get
{
if (!HasData)
throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
return _data;
}
}
internal static void ValidateResourceId(ResourceIdentifier id)
{
if (id.ResourceType != ResourceType)
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id));
}
/// <summary> Gets a collection of ImageVersionResources in the Image. </summary>
/// <returns> An object representing collection of ImageVersionResources and their operations over a ImageVersionResource. </returns>
public virtual ImageVersionCollection GetImageVersions()
{
return GetCachedClient(Client => new ImageVersionCollection(Client, Id));
}
/// <summary>
/// Gets an image version.
/// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions/{versionName}
/// Operation Id: ImageVersions_Get
/// </summary>
/// <param name="versionName"> The version of the image. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentException"> <paramref name="versionName"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="ArgumentNullException"> <paramref name="versionName"/> is null. </exception>
[ForwardsClientCalls]
public virtual async Task<Response<ImageVersionResource>> GetImageVersionAsync(string versionName, CancellationToken cancellationToken = default)
{
return await GetImageVersions().GetAsync(versionName, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Gets an image version.
/// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions/{versionName}
/// Operation Id: ImageVersions_Get
/// </summary>
/// <param name="versionName"> The version of the image. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentException"> <paramref name="versionName"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="ArgumentNullException"> <paramref name="versionName"/> is null. </exception>
[ForwardsClientCalls]
public virtual Response<ImageVersionResource> GetImageVersion(string versionName, CancellationToken cancellationToken = default)
{
return GetImageVersions().Get(versionName, cancellationToken);
}
/// <summary>
/// Gets a gallery image.
/// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}
/// Operation Id: Images_Get
/// </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response<ImageResource>> GetAsync(CancellationToken cancellationToken = default)
{
using var scope = _imageClientDiagnostics.CreateScope("ImageResource.Get");
scope.Start();
try
{
var response = await _imageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
if (response.Value == null)
throw new RequestFailedException(response.GetRawResponse());
return Response.FromValue(new ImageResource(Client, response.Value), response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// Gets a gallery image.
/// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}
/// Operation Id: Images_Get
/// </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response<ImageResource> Get(CancellationToken cancellationToken = default)
{
using var scope = _imageClientDiagnostics.CreateScope("ImageResource.Get");
scope.Start();
try
{
var response = _imageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
if (response.Value == null)
throw new RequestFailedException(response.GetRawResponse());
return Response.FromValue(new ImageResource(Client, response.Value), response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
}
}
| {
"content_hash": "68965bd373d1a92fa14624e275f5655d",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 215,
"avg_line_length": 53.34730538922156,
"alnum_prop": 0.6609047031092155,
"repo_name": "Azure/azure-sdk-for-net",
"id": "e8ac6abfbc63751af6e0eb684c86b879534f50d1",
"size": "9047",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/devcenter/Azure.ResourceManager.DevCenter/src/Generated/ImageResource.cs",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
``` diff
namespace System.Security.Claims {
public static class PrincipalExtensions {
- public static string FindFirstValue(this ClaimsPrincipal principal, string claimType);
+ public static string? FindFirstValue(this ClaimsPrincipal principal, string claimType);
}
}
```
| {
"content_hash": "9c017e7de2407be1be63a58c0269a495",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 96,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.73,
"repo_name": "dotnet/core",
"id": "c3834a0d40fd164aacf1bb5769b13ccff1869761",
"size": "326",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "release-notes/7.0/preview/api-diff/preview2/Microsoft.AspNetCore.App/7.0-preview2_System.Security.Claims.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PowerShell",
"bytes": "15707"
},
{
"name": "Shell",
"bytes": "5074"
}
],
"symlink_target": ""
} |
@interface PFXPlugin : NSObject
- (void)executeWithInfo:(NSDictionary *)infoDict completion:(void(^)(NSDictionary *resultDict))completion failure:(void(^)(NSError *error))failure;
@end
| {
"content_hash": "ba69550b9b5ea4708f032df9a9307f9c",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 147,
"avg_line_length": 37.4,
"alnum_prop": 0.7700534759358288,
"repo_name": "PFXStudio/PFXFrameworks",
"id": "fb27b9165c2a42650002968412104e5203f5787e",
"size": "402",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PFXPluginSDK/PFXPluginSDK/Plugins/PFXPlugin.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "19295"
}
],
"symlink_target": ""
} |
#ifdef E_TYPEDEFS
typedef struct _E_Action E_Action;
typedef struct _E_Action_Description E_Action_Description;
typedef struct _E_Action_Group E_Action_Group;
#else
#ifndef E_ACTIONS_H
#define E_ACTIONS_H
#define E_ACTION_TYPE 0xE0b01010
struct _E_Action
{
E_Object e_obj_inherit;
const char *name;
struct
{
void (*go)(E_Object *obj, const char *params);
void (*go_mouse)(E_Object *obj, const char *params, E_Binding_Event_Mouse_Button *ev);
void (*go_wheel)(E_Object *obj, const char *params, E_Binding_Event_Wheel *ev);
void (*go_edge)(E_Object *obj, const char *params, E_Event_Zone_Edge *ev);
void (*go_key)(E_Object *obj, const char *params, Ecore_Event_Key *ev);
void (*go_signal)(E_Object *obj, const char *params, const char *sig, const char *src);
void (*end)(E_Object *obj, const char *params);
void (*end_mouse)(E_Object *obj, const char *params, E_Binding_Event_Mouse_Button *ev);
void (*end_key)(E_Object *obj, const char *params, Ecore_Event_Key *ev);
} func;
};
struct _E_Action_Description
{
const char *act_name;
const char *act_cmd;
const char *act_params;
const char *param_example;
int editable;
};
struct _E_Action_Group
{
const char *act_grp;
Eina_List *acts;
};
EINTERN int e_actions_init(void);
EINTERN int e_actions_shutdown(void);
E_API Eina_List *e_action_name_list(void);
E_API E_Action *e_action_add(const char *name);
/* e_action_del allows, for example, modules to define their own actions dynamically. */
E_API void e_action_del(const char *name);
E_API E_Action *e_action_find(const char *name);
E_API const char *e_action_predef_label_get(const char *action, const char *params);
E_API void e_action_predef_name_set(const char *act_grp, const char *act_name, const char *act_cmd, const char *act_params, const char *param_example, int editable);
E_API void e_action_predef_name_del(const char *act_grp, const char *act_name);
E_API void e_action_predef_name_all_del(void);
E_API Eina_List *e_action_groups_get(void);
#endif
#endif
| {
"content_hash": "5c9086b816c5ec6908d44ed6b65cff09",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 172,
"avg_line_length": 33.96825396825397,
"alnum_prop": 0.6658878504672897,
"repo_name": "tizenorg/platform.upstream.enlightenment",
"id": "0cbfdea834cb0db79ca8cf86d70611b597c2a6ff",
"size": "2140",
"binary": false,
"copies": "1",
"ref": "refs/heads/accepted/tizen_common",
"path": "src/bin/e_actions.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "1876892"
},
{
"name": "C++",
"bytes": "4328"
},
{
"name": "M4",
"bytes": "30681"
},
{
"name": "Makefile",
"bytes": "19392"
},
{
"name": "Objective-C",
"bytes": "3811"
},
{
"name": "Shell",
"bytes": "41304"
}
],
"symlink_target": ""
} |
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti5.engine.impl.cmd;
import java.io.Serializable;
import org.activiti5.engine.ActivitiException;
import org.activiti5.engine.ActivitiObjectNotFoundException;
import org.activiti5.engine.form.TaskFormData;
import org.activiti5.engine.impl.form.FormEngine;
import org.activiti5.engine.impl.form.TaskFormHandler;
import org.activiti5.engine.impl.interceptor.Command;
import org.activiti5.engine.impl.interceptor.CommandContext;
import org.activiti5.engine.impl.persistence.entity.TaskEntity;
import org.activiti5.engine.task.Task;
/**
* @author Tom Baeyens
*/
public class GetRenderedTaskFormCmd implements Command<Object>, Serializable {
private static final long serialVersionUID = 1L;
protected String taskId;
protected String formEngineName;
public GetRenderedTaskFormCmd(String taskId, String formEngineName) {
this.taskId = taskId;
this.formEngineName = formEngineName;
}
public Object execute(CommandContext commandContext) {
TaskEntity task = commandContext
.getTaskEntityManager()
.findTaskById(taskId);
if (task == null) {
throw new ActivitiObjectNotFoundException("Task '" + taskId +"' not found", Task.class);
}
if (task.getTaskDefinition() == null) {
throw new ActivitiException("Task form definition for '" + taskId +"' not found");
}
TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
if (taskFormHandler == null) {
return null;
}
FormEngine formEngine = commandContext
.getProcessEngineConfiguration()
.getFormEngines()
.get(formEngineName);
if (formEngine==null) {
throw new ActivitiException("No formEngine '" + formEngineName +"' defined process engine configuration");
}
TaskFormData taskForm = taskFormHandler.createTaskForm(task);
return formEngine.renderTaskForm(taskForm);
}
}
| {
"content_hash": "0148157759136c3783aa157e0cdcaf79",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 112,
"avg_line_length": 33.513513513513516,
"alnum_prop": 0.7362903225806452,
"repo_name": "stefan-ziel/Activiti",
"id": "e6fa20c69033a3808a0b56290a00f6bbb2685264",
"size": "2480",
"binary": false,
"copies": "3",
"ref": "refs/heads/6.x-c",
"path": "modules/activiti5-engine/src/main/java/org/activiti5/engine/impl/cmd/GetRenderedTaskFormCmd.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "166"
},
{
"name": "CSS",
"bytes": "292473"
},
{
"name": "HTML",
"bytes": "774326"
},
{
"name": "Java",
"bytes": "20888915"
},
{
"name": "JavaScript",
"bytes": "8873337"
},
{
"name": "PLSQL",
"bytes": "1426"
},
{
"name": "PLpgSQL",
"bytes": "4868"
},
{
"name": "Shell",
"bytes": "8194"
}
],
"symlink_target": ""
} |
FROM ubuntu:12.04
MAINTAINER Tyson Bailey <tyson@onaclovtech.com>
# Install system dependencies
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y unzip
RUN apt-get install -y wget
RUN apt-get install -y clang
RUN apt-get install -y cmake
RUN apt-get install -y python2.7
RUN apt-get install -y python2.7-dev
RUN apt-get install -y python-setuptools
RUN apt-get install -y python-nose
RUN wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py -O - | python
# SimpleCV Specific
RUN apt-get install -y libopencv-*
RUN apt-get install -y python-opencv
RUN apt-get install -y python-numpy
RUN apt-get install -y python-scipy
RUN apt-get install -y python-pygame
# RUN pip install PIL
RUN pip install ipython
RUN pip install pyzmq
RUN pip install jinja2
RUN pip install tornado
# SimpleCV Install
RUN wget https://github.com/onaclovtech/SimpleCV/archive/master.zip
RUN unzip master
RUN cd SimpleCV-master; pip install -r requirements.txt; python setup.py install
# Use clang
ENV CC clang
ENV CXX clang++
# Environment setup
EXPOSE 8888
ENV USER docker
WORKDIR /home/docker
# Setup the notebook
RUN echo 'ipython notebook --ip=0.0.0.0 --port=8888 --no-browser' >> start.sh
RUN chmod +x start.sh
CMD bash -C '/home/docker/start.sh';'bash'
| {
"content_hash": "48d1b02222fdbc7a19be23d2ec939195",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 80,
"avg_line_length": 27.106382978723403,
"alnum_prop": 0.7653061224489796,
"repo_name": "onaclovtech/SimpleCV",
"id": "497a2703b4cea8d5104df2b8fe4f4f43775e3d46",
"size": "1374",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Dockerfile",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1728"
},
{
"name": "CSS",
"bytes": "1187"
},
{
"name": "HTML",
"bytes": "17691"
},
{
"name": "JavaScript",
"bytes": "13899"
},
{
"name": "NSIS",
"bytes": "10632"
},
{
"name": "Perl",
"bytes": "5044"
},
{
"name": "Python",
"bytes": "1699872"
},
{
"name": "Shell",
"bytes": "10617"
}
],
"symlink_target": ""
} |
package li.strolch.agent.api;
import li.strolch.persistence.api.StrolchTransaction;
import li.strolch.privilege.model.Certificate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class AbstractModelObserver {
protected static final Logger logger = LoggerFactory.getLogger(AbstractModelObserver.class);
private final ComponentContainer container;
public AbstractModelObserver(ComponentContainer container) {
this.container = container;
}
public ComponentContainer getContainer() {
return this.container;
}
protected StrolchTransaction openTx(Certificate cert) {
return this.container.getRealm(cert).openTx(cert, getClass(), false);
}
}
| {
"content_hash": "a7a8fcbabda4992d36ff879a041eb378",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 93,
"avg_line_length": 27.24,
"alnum_prop": 0.8076358296622613,
"repo_name": "eitchnet/strolch",
"id": "c279e57f7f3392cc522cdeda85c18c8a9864cb95",
"size": "681",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "li.strolch.agent/src/main/java/li/strolch/agent/api/AbstractModelObserver.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6493"
},
{
"name": "HTML",
"bytes": "204515"
},
{
"name": "Java",
"bytes": "3199765"
},
{
"name": "JavaScript",
"bytes": "31260"
},
{
"name": "Shell",
"bytes": "2833"
}
],
"symlink_target": ""
} |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict
import io
import os
import sys
import numpy as np # type: ignore
from onnx import defs, FunctionProto, helper, OperatorStatus
from onnx.defs import OpSchema, ONNX_DOMAIN, ONNX_ML_DOMAIN
from onnx.backend.test.case import collect_snippets
from typing import Any, Text, Sequence, Dict, List, Type, Set, Tuple
SNIPPETS = collect_snippets()
ONNX_ML = bool(os.getenv('ONNX_ML') == '1')
if ONNX_ML:
ext = '-ml.md'
else:
ext = '.md'
def display_number(v): # type: (int) -> Text
if defs.OpSchema.is_infinite(v):
return '∞'
return Text(v)
def should_render_domain(domain): # type: (Text) -> bool
if domain == ONNX_ML_DOMAIN and not ONNX_ML:
return False
elif ONNX_ML and domain != ONNX_ML_DOMAIN:
return False
return True
def format_name_with_domain(domain, schema_name): # type: (Text, Text) -> Text
if domain:
return '{}.{}'.format(domain, schema_name)
else:
return schema_name
def display_attr_type(v): # type: (OpSchema.AttrType) -> Text
assert isinstance(v, OpSchema.AttrType)
s = Text(v)
s = s[s.rfind('.') + 1:].lower()
if s[-1] == 's':
s = 'list of ' + s
return s
def display_domain(domain): # type: (Text) -> Text
if domain:
return "the '{}' operator set".format(domain)
else:
return "the default ONNX operator set"
def display_domain_short(domain): # type: (Text) -> Text
if domain:
return domain
else:
return 'ai.onnx (default)'
def display_version_link(name, version): # type: (Text, int) -> Text
changelog_md = 'Changelog' + ext
name_with_ver = '{}-{}'.format(name, version)
return '<a href="{}#{}">{}</a>'.format(changelog_md, name_with_ver, name_with_ver)
def display_function_version_link(name, version): # type: (Text, int) -> Text
changelog_md = 'FunctionsChangelog' + ext
name_with_ver = '{}-{}'.format(name, version)
return '<a href="{}#{}">{}</a>'.format(changelog_md, name_with_ver, name_with_ver)
def display_schema(schema, versions): # type: (OpSchema, Sequence[OpSchema]) -> Text
s = ''
# doc
if schema.doc:
s += '\n'
s += '\n'.join(' ' + line
for line in schema.doc.lstrip().splitlines())
s += '\n'
# since version
s += '\n#### Version\n'
s += '\nThis version of the operator has been ' + ('deprecated' if schema.deprecated else 'available') + ' since version {}'.format(schema.since_version)
s += ' of {}.\n'.format(display_domain(schema.domain))
if len(versions) > 1:
# TODO: link to the Changelog.md
s += '\nOther versions of this operator: {}\n'.format(
', '.join(display_version_link(format_name_with_domain(v.domain, v.name),
v.since_version) for v in versions[:-1]))
# If this schema is deprecated, don't display any of the following sections
if schema.deprecated:
return s
# attributes
if schema.attributes:
s += '\n#### Attributes\n\n'
s += '<dl>\n'
for _, attr in sorted(schema.attributes.items()):
# option holds either required or default value
opt = ''
if attr.required:
opt = 'required'
elif attr.default_value.name:
default_value = helper.get_attribute_value(attr.default_value)
def format_value(value): # type: (Any) -> Text
if isinstance(value, float):
value = np.round(value, 5)
if isinstance(value, (bytes, bytearray)) and sys.version_info[0] == 3:
value = value.decode('utf-8')
return str(value)
if isinstance(default_value, list):
default_value = [format_value(val) for val in default_value]
else:
default_value = format_value(default_value)
opt = 'default is {}'.format(default_value)
s += '<dt><tt>{}</tt> : {}{}</dt>\n'.format(
attr.name,
display_attr_type(attr.type),
' ({})'.format(opt) if opt else '')
s += '<dd>{}</dd>\n'.format(attr.description)
s += '</dl>\n'
# inputs
s += '\n#### Inputs'
if schema.min_input != schema.max_input:
s += ' ({} - {})'.format(display_number(schema.min_input),
display_number(schema.max_input))
s += '\n\n'
if schema.inputs:
s += '<dl>\n'
for input in schema.inputs:
option_str = ""
if OpSchema.FormalParameterOption.Optional == input.option:
option_str = " (optional)"
elif OpSchema.FormalParameterOption.Variadic == input.option:
if input.isHomogeneous:
option_str = " (variadic)"
else:
option_str = " (variadic, heterogeneous)"
s += '<dt><tt>{}</tt>{} : {}</dt>\n'.format(input.name, option_str, input.typeStr)
s += '<dd>{}</dd>\n'.format(input.description)
s += '</dl>\n'
# outputs
s += '\n#### Outputs'
if schema.min_output != schema.max_output:
s += ' ({} - {})'.format(display_number(schema.min_output),
display_number(schema.max_output))
s += '\n\n'
if schema.outputs:
s += '<dl>\n'
for output in schema.outputs:
option_str = ""
if OpSchema.FormalParameterOption.Optional == output.option:
option_str = " (optional)"
elif OpSchema.FormalParameterOption.Variadic == output.option:
if output.isHomogeneous:
option_str = " (variadic)"
else:
option_str = " (variadic, heterogeneous)"
s += '<dt><tt>{}</tt>{} : {}</dt>\n'.format(output.name, option_str, output.typeStr)
s += '<dd>{}</dd>\n'.format(output.description)
s += '</dl>\n'
# type constraints
s += '\n#### Type Constraints'
s += '\n\n'
if schema.type_constraints:
s += '<dl>\n'
for type_constraint in schema.type_constraints:
allowedTypes = type_constraint.allowed_type_strs
if (len(allowedTypes) > 0):
allowedTypeStr = allowedTypes[0]
for allowedType in allowedTypes[1:]:
allowedTypeStr += ', ' + allowedType
s += '<dt><tt>{}</tt> : {}</dt>\n'.format(
type_constraint.type_param_str, allowedTypeStr)
s += '<dd>{}</dd>\n'.format(type_constraint.description)
s += '</dl>\n'
return s
def display_function(function, versions, domain=ONNX_DOMAIN): # type: (FunctionProto, List[int], Text) -> Text
s = ''
if domain:
domain_prefix = '{}.'.format(ONNX_ML_DOMAIN)
else:
domain_prefix = ''
# doc
if function.doc_string:
s += '\n'
s += '\n'.join(' ' + line
for line in function.doc_string.lstrip().splitlines())
s += '\n'
# since version
s += '\n#### Version\n'
s += '\nThis version of the function has been available since version {}'.format(function.since_version)
s += ' of {}.\n'.format(display_domain(domain_prefix))
if len(versions) > 1:
s += '\nOther versions of this function: {}\n'.format(
', '.join(display_function_version_link(domain_prefix + function.name, v) for v in versions if v != function.since_version))
# inputs
s += '\n#### Inputs'
s += '\n\n'
if function.input:
s += '<dl>\n'
for input in function.input:
s += '<dt>{}; </dt>\n'.format(input)
s += '<br/></dl>\n'
# outputs
s += '\n#### Outputs'
s += '\n\n'
if function.output:
s += '<dl>\n'
for output in function.output:
s += '<dt>{}; </dt>\n'.format(output)
s += '<br/></dl>\n'
# attributes
if function.attribute:
s += '\n#### Attributes\n\n'
s += '<dl>\n'
for attr in function.attribute:
s += '<dt>{};<br/></dt>\n'.format(attr)
s += '</dl>\n'
return s
def support_level_str(level): # type: (OpSchema.SupportType) -> Text
return \
"<sub>experimental</sub> " if level == OpSchema.SupportType.EXPERIMENTAL else ""
def function_status_str(status=OperatorStatus.Value("EXPERIMENTAL")): # type: ignore
return \
"<sub>experimental</sub> " if status == OperatorStatus.Value('EXPERIMENTAL') else "" # type: ignore
def main(args): # type: (Type[Args]) -> None
with io.open(args.changelog, 'w', newline='') as fout:
fout.write('## Operator Changelog\n')
fout.write(
"*This file is automatically generated from the\n"
" [def files](/onnx/defs) via [this script](/onnx/defs/gen_doc.py).\n"
" Do not modify directly and instead edit operator definitions.*\n")
# domain -> version -> [schema]
dv_index = defaultdict(lambda: defaultdict(list)) # type: Dict[Text, Dict[int, List[OpSchema]]]
for schema in defs.get_all_schemas_with_history():
dv_index[schema.domain][schema.since_version].append(schema)
fout.write('\n')
for domain, versionmap in sorted(dv_index.items()):
if not should_render_domain(domain):
continue
s = '# {}\n'.format(display_domain_short(domain))
for version, unsorted_schemas in sorted(versionmap.items()):
s += '## Version {} of {}\n'.format(version, display_domain(domain))
for schema in sorted(unsorted_schemas, key=lambda s: s.name):
name_with_ver = '{}-{}'.format(format_name_with_domain(domain, schema.name),
schema.since_version)
s += ('### <a name="{}"></a>**{}**' + (' (deprecated)' if schema.deprecated else '') + '</a>\n').format(name_with_ver, name_with_ver)
s += display_schema(schema, [schema])
s += '\n'
fout.write(s)
with io.open(args.fn_changelog, 'w', newline='') as fout:
fout.write('## Function Changelog\n')
fout.write(
"*This file is automatically generated from the\n"
" [def files](/onnx/defs) via [this script](/onnx/defs/gen_doc.py).\n"
" Do not modify directly and instead edit function definitions.*\n")
if os.getenv('ONNX_ML'):
all_functions = defs.get_functions(ONNX_ML_DOMAIN)
else:
all_functions = defs.get_functions('')
changelog_versionmap = defaultdict(list) # type: Dict[int, List[FunctionProto]]
for fn_name, functions in sorted(all_functions.items()):
for func in functions:
changelog_versionmap[func.since_version].append(func)
if os.getenv('ONNX_ML'):
s = '## {}\n'.format(ONNX_ML_DOMAIN)
domain_display_name = ONNX_ML_DOMAIN
domain_prefix = '{}.'.format(ONNX_ML_DOMAIN)
else:
s = '# ai.onnx (default)\n'
domain_display_name = 'ai.onnx (default)'
domain_prefix = ''
fout.write(s)
for version, function_list in sorted(changelog_versionmap.items()):
s = ""
for function in function_list:
s += '## Version {} of domain {}\n'.format(version, domain_display_name)
name_with_ver = '{}-{}'.format(domain_prefix
+ fn_name, function.since_version)
s += '### <a name="{}"></a>**{}**</a>\n'.format(name_with_ver, name_with_ver)
available_versions = [func.since_version for func in all_functions[function.name]]
s += display_function(function, available_versions, domain_prefix)
s += '\n'
fout.write(s)
with io.open(args.output, 'w', newline='') as fout:
fout.write('## Operator Schemas\n')
fout.write(
"*This file is automatically generated from the\n"
" [def files](/onnx/defs) via [this script](/onnx/defs/gen_doc.py).\n"
" Do not modify directly and instead edit operator definitions.*\n")
# domain -> support level -> name -> [schema]
index = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # type: Dict[Text, Dict[int, Dict[Text, List[OpSchema]]]]
for schema in defs.get_all_schemas_with_history():
index[schema.domain][int(schema.support_level)][schema.name].append(schema)
fout.write('\n')
# Preprocess the Operator Schemas
# [(domain, [(support_level, [(schema name, current schema, all versions schemas)])])]
operator_schemas = list() # type: List[Tuple[Text, List[Tuple[int, List[Tuple[Text, OpSchema, List[OpSchema]]]]]]]
exsting_ops = set() # type: Set[Text]
for domain, _supportmap in sorted(index.items()):
if not should_render_domain(domain):
continue
processed_supportmap = list()
for _support, _namemap in sorted(_supportmap.items()):
processed_namemap = list()
for n, unsorted_versions in sorted(_namemap.items()):
versions = sorted(unsorted_versions, key=lambda s: s.since_version)
schema = versions[-1]
if schema.name in exsting_ops:
continue
exsting_ops.add(schema.name)
processed_namemap.append((n, schema, versions))
processed_supportmap.append((_support, processed_namemap))
operator_schemas.append((domain, processed_supportmap))
# Table of contents
for domain, supportmap in operator_schemas:
s = '* {}\n'.format(display_domain_short(domain))
fout.write(s)
for _, namemap in supportmap:
for n, schema, versions in namemap:
s = ' * {}<a href="#{}">{}</a>\n'.format(
support_level_str(schema.support_level),
format_name_with_domain(domain, n),
format_name_with_domain(domain, n))
fout.write(s)
fout.write('\n')
for domain, supportmap in operator_schemas:
s = '## {}\n'.format(display_domain_short(domain))
fout.write(s)
for _, namemap in supportmap:
for op_type, schema, versions in namemap:
# op_type
s = ('### {}<a name="{}"></a><a name="{}">**{}**' + (' (deprecated)' if schema.deprecated else '') + '</a>\n').format(
support_level_str(schema.support_level),
format_name_with_domain(domain, op_type),
format_name_with_domain(domain, op_type.lower()),
format_name_with_domain(domain, op_type))
s += display_schema(schema, versions)
s += '\n\n'
if op_type in SNIPPETS:
s += '#### Examples\n\n'
for summary, code in sorted(SNIPPETS[op_type]):
s += '<details>\n'
s += '<summary>{}</summary>\n\n'.format(summary)
s += '```python\n{}\n```\n\n'.format(code)
s += '</details>\n'
s += '\n\n'
fout.write(s)
with io.open(args.function_output, 'w', newline='') as fout:
fout.write('## Functions\n')
fout.write(
"*This file is automatically generated from the\n"
" [def files](/onnx/defs) via [this script](/onnx/defs/gen_doc.py).\n"
" Do not modify directly and instead edit function definitions.*\n")
if os.getenv('ONNX_ML'):
all_functions = defs.get_functions(ONNX_ML_DOMAIN)
else:
all_functions = defs.get_functions('')
if all_functions:
if os.getenv('ONNX_ML'):
s = '## {}\n'.format(ONNX_ML_DOMAIN)
domain_prefix = '{}.'.format(ONNX_ML_DOMAIN)
else:
s = '## ai.onnx (default)\n'
domain_prefix = ''
fout.write(s)
existing_functions = set() # type: Set[Text]
for function_name, functions in sorted(all_functions.items()):
for function in sorted(functions, key=lambda s: s.since_version, reverse=True):
if function.name in existing_functions:
continue
existing_functions.add(function.name)
s = ' * {}<a href="#{}">{}</a>\n'.format(
function_status_str(function.status),
domain_prefix + function.name, domain_prefix + function.name)
fout.write(s)
fout.write('\n')
fout.write('\n\n')
for function_name, functions in sorted(all_functions.items()):
available_versions = [func.since_version for func in functions]
function = sorted(functions, key=lambda s: s.since_version, reverse=True)[0]
s = '### {}<a name="{}"></a><a name="{}">**{}**</a>\n'.format(
function_status_str(function.status),
domain_prefix + function.name, domain_prefix + function.name.lower(),
domain_prefix + function.name)
s += display_function(function, available_versions, domain_prefix)
s += '\n\n'
fout.write(s)
if __name__ == '__main__':
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
docs_dir = os.path.join(base_dir, 'docs')
class Args(object):
output = os.path.join(docs_dir, 'Operators' + ext)
function_output = os.path.join(docs_dir, 'Functions' + ext)
changelog = os.path.join(docs_dir, 'Changelog' + ext)
fn_changelog = os.path.join(docs_dir, 'FunctionsChangelog' + ext)
main(Args)
| {
"content_hash": "cf4362e9b41426b39e0602330dbf76f9",
"timestamp": "",
"source": "github",
"line_count": 471,
"max_line_length": 157,
"avg_line_length": 39.61571125265393,
"alnum_prop": 0.5289672544080605,
"repo_name": "mlperf/training_results_v0.7",
"id": "c60ef5011ce9d55a0eeeb48faa053faab2b9c878",
"size": "18681",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/onnx-tensorrt/third_party/onnx/onnx/defs/gen_doc.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "1731"
},
{
"name": "Awk",
"bytes": "14530"
},
{
"name": "Batchfile",
"bytes": "13130"
},
{
"name": "C",
"bytes": "172914"
},
{
"name": "C++",
"bytes": "13037795"
},
{
"name": "CMake",
"bytes": "113458"
},
{
"name": "CSS",
"bytes": "70255"
},
{
"name": "Clojure",
"bytes": "622652"
},
{
"name": "Cuda",
"bytes": "1974745"
},
{
"name": "Dockerfile",
"bytes": "149523"
},
{
"name": "Groovy",
"bytes": "160449"
},
{
"name": "HTML",
"bytes": "171537"
},
{
"name": "Java",
"bytes": "189275"
},
{
"name": "JavaScript",
"bytes": "98224"
},
{
"name": "Julia",
"bytes": "430755"
},
{
"name": "Jupyter Notebook",
"bytes": "11091342"
},
{
"name": "Lua",
"bytes": "17720"
},
{
"name": "MATLAB",
"bytes": "34903"
},
{
"name": "Makefile",
"bytes": "215967"
},
{
"name": "Perl",
"bytes": "1551186"
},
{
"name": "PowerShell",
"bytes": "13906"
},
{
"name": "Python",
"bytes": "36943114"
},
{
"name": "R",
"bytes": "134921"
},
{
"name": "Raku",
"bytes": "7280"
},
{
"name": "Ruby",
"bytes": "4930"
},
{
"name": "SWIG",
"bytes": "140111"
},
{
"name": "Scala",
"bytes": "1304960"
},
{
"name": "Shell",
"bytes": "1312832"
},
{
"name": "Smalltalk",
"bytes": "3497"
},
{
"name": "Starlark",
"bytes": "69877"
},
{
"name": "TypeScript",
"bytes": "243012"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Sql;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
public partial class showattributesbehaviorsbtn : System.Web.UI.Page
{
public int Foreign_Key;
private string connectionString = @"Data Source=.;Initial Catalog=UML;Integrated Security=True";
private string finalString = "";
private string relationshipFinalString = "";
private List<int> ids = new List<int>();
private List<string> entities = new List<string>();
private List<string> attributesSections = new List<string>();
private List<string> BehaviorsSections = new List<string>();
private List<string> packages = new List<string>();
private List<string> ERDpackages = new List<string>();
private List<SqlDataReader> readers = new List<SqlDataReader>();
private List<SqlCommand> commands = new List<SqlCommand>();
private List<string> relationship = new List<string>();
private string ClassDiagram;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_showaddbehaviors_Click(object sender, EventArgs e)
{
Response.Redirect("addbehaviors.aspx");
}
protected void btn_showaddattributes_Click(object sender, EventArgs e)
{
Response.Redirect("addattributes.aspx");
}
} | {
"content_hash": "56eb9f082e1b4dd0fa11ed236d289f74",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 100,
"avg_line_length": 27.68421052631579,
"alnum_prop": 0.6926489226869454,
"repo_name": "WaqasAhmadSkt/UML",
"id": "027a8852707273c96cf9382ccc1c1b1fe3d2709a",
"size": "1580",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "showattributesbehaviorsbtn.aspx.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "91449"
},
{
"name": "C#",
"bytes": "90938"
},
{
"name": "CSS",
"bytes": "28868"
},
{
"name": "HTML",
"bytes": "11148"
},
{
"name": "JavaScript",
"bytes": "153946"
},
{
"name": "Yacc",
"bytes": "1493"
}
],
"symlink_target": ""
} |
/* jshint maxlen: false */
'use strict';
var createAPIRequest = require('../../lib/apirequest');
/**
* Google App Engine Admin API
*
* @classdesc Provisions and manages App Engine applications.
* @namespace appengine
* @version v1beta5
* @variation v1beta5
* @this Appengine
* @param {object=} options Options for Appengine
*/
function Appengine(options) {
var self = this;
this._options = options || {};
this.apps = {
/**
* appengine.apps.get
*
* @desc Gets information about an application.
*
* @alias appengine.apps.get
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the application to get. For example: "apps/myapp".
* @param {boolean=} params.ensureResourcesExist - Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the `GET` operation. If specified and any resources could not be created, the request will fail with an error code. Additionally, this parameter can cause the request to take longer to complete. Note: This parameter will be deprecated in a future version of the API.
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
get: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}',
method: 'GET'
},
params: params,
requiredParams: ['appsId'],
pathParams: ['appsId'],
context: self
};
return createAPIRequest(parameters, callback);
},
operations: {
/**
* appengine.apps.operations.get
*
* @desc Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
*
* @alias appengine.apps.operations.get
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. The name of the operation resource.
* @param {string} params.operationsId - Part of `name`. See documentation of `appsId`.
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
get: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/operations/{operationsId}',
method: 'GET'
},
params: params,
requiredParams: ['appsId', 'operationsId'],
pathParams: ['appsId', 'operationsId'],
context: self
};
return createAPIRequest(parameters, callback);
},
/**
* appengine.apps.operations.list
*
* @desc Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/x/operations`.
*
* @alias appengine.apps.operations.list
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. The name of the operation collection.
* @param {string=} params.filter - The standard list filter.
* @param {integer=} params.pageSize - The standard list page size.
* @param {string=} params.pageToken - The standard list page token.
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
list: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/operations',
method: 'GET'
},
params: params,
requiredParams: ['appsId'],
pathParams: ['appsId'],
context: self
};
return createAPIRequest(parameters, callback);
}
},
services: {
/**
* appengine.apps.services.delete
*
* @desc Deletes a service and all enclosed versions.
*
* @alias appengine.apps.services.delete
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the resource requested. For example: "apps/myapp/services/default".
* @param {string} params.servicesId - Part of `name`. See documentation of `appsId`.
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
delete: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}',
method: 'DELETE'
},
params: params,
requiredParams: ['appsId', 'servicesId'],
pathParams: ['appsId', 'servicesId'],
context: self
};
return createAPIRequest(parameters, callback);
},
/**
* appengine.apps.services.get
*
* @desc Gets the current configuration of the service.
*
* @alias appengine.apps.services.get
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the resource requested. For example: "apps/myapp/services/default".
* @param {string} params.servicesId - Part of `name`. See documentation of `appsId`.
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
get: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}',
method: 'GET'
},
params: params,
requiredParams: ['appsId', 'servicesId'],
pathParams: ['appsId', 'servicesId'],
context: self
};
return createAPIRequest(parameters, callback);
},
/**
* appengine.apps.services.list
*
* @desc Lists all the services in the application.
*
* @alias appengine.apps.services.list
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the resource requested. For example: "apps/myapp".
* @param {integer=} params.pageSize - Maximum results to return per page.
* @param {string=} params.pageToken - Continuation token for fetching the next page of results.
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
list: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/services',
method: 'GET'
},
params: params,
requiredParams: ['appsId'],
pathParams: ['appsId'],
context: self
};
return createAPIRequest(parameters, callback);
},
/**
* appengine.apps.services.patch
*
* @desc Updates the configuration of the specified service.
*
* @alias appengine.apps.services.patch
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the resource to update. For example: "apps/myapp/services/default".
* @param {string} params.servicesId - Part of `name`. See documentation of `appsId`.
* @param {string=} params.mask - Standard field mask for the set of fields to be updated.
* @param {boolean=} params.migrateTraffic - Whether to use Traffic Migration to shift traffic gradually. Traffic can only be migrated from a single version to another single version.
* @param {object} params.resource - Request body data
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
patch: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}',
method: 'PATCH'
},
params: params,
requiredParams: ['appsId', 'servicesId'],
pathParams: ['appsId', 'servicesId'],
context: self
};
return createAPIRequest(parameters, callback);
},
versions: {
/**
* appengine.apps.services.versions.create
*
* @desc Deploys new code and resource files to a version.
*
* @alias appengine.apps.services.versions.create
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the resource to update. For example: "apps/myapp/services/default".
* @param {string} params.servicesId - Part of `name`. See documentation of `appsId`.
* @param {object} params.resource - Request body data
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
create: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}/versions',
method: 'POST'
},
params: params,
requiredParams: ['appsId', 'servicesId'],
pathParams: ['appsId', 'servicesId'],
context: self
};
return createAPIRequest(parameters, callback);
},
/**
* appengine.apps.services.versions.delete
*
* @desc Deletes an existing version.
*
* @alias appengine.apps.services.versions.delete
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the resource requested. For example: "apps/myapp/services/default/versions/v1".
* @param {string} params.servicesId - Part of `name`. See documentation of `appsId`.
* @param {string} params.versionsId - Part of `name`. See documentation of `appsId`.
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
delete: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}',
method: 'DELETE'
},
params: params,
requiredParams: ['appsId', 'servicesId', 'versionsId'],
pathParams: ['appsId', 'servicesId', 'versionsId'],
context: self
};
return createAPIRequest(parameters, callback);
},
/**
* appengine.apps.services.versions.get
*
* @desc Gets application deployment information.
*
* @alias appengine.apps.services.versions.get
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the resource requested. For example: "apps/myapp/services/default/versions/v1".
* @param {string} params.servicesId - Part of `name`. See documentation of `appsId`.
* @param {string} params.versionsId - Part of `name`. See documentation of `appsId`.
* @param {string=} params.view - Controls the set of fields returned in the `Get` response.
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
get: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}',
method: 'GET'
},
params: params,
requiredParams: ['appsId', 'servicesId', 'versionsId'],
pathParams: ['appsId', 'servicesId', 'versionsId'],
context: self
};
return createAPIRequest(parameters, callback);
},
/**
* appengine.apps.services.versions.list
*
* @desc Lists the versions of a service.
*
* @alias appengine.apps.services.versions.list
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the resource requested. For example: "apps/myapp/services/default".
* @param {string} params.servicesId - Part of `name`. See documentation of `appsId`.
* @param {string=} params.view - Controls the set of fields returned in the `List` response.
* @param {integer=} params.pageSize - Maximum results to return per page.
* @param {string=} params.pageToken - Continuation token for fetching the next page of results.
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
list: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}/versions',
method: 'GET'
},
params: params,
requiredParams: ['appsId', 'servicesId'],
pathParams: ['appsId', 'servicesId'],
context: self
};
return createAPIRequest(parameters, callback);
},
/**
* appengine.apps.services.versions.patch
*
* @desc Updates an existing version. Note: UNIMPLEMENTED.
*
* @alias appengine.apps.services.versions.patch
* @memberOf! appengine(v1beta5)
*
* @param {object} params - Parameters for request
* @param {string} params.appsId - Part of `name`. Name of the resource to update. For example: "apps/myapp/services/default/versions/1".
* @param {string} params.servicesId - Part of `name`. See documentation of `appsId`.
* @param {string} params.versionsId - Part of `name`. See documentation of `appsId`.
* @param {string=} params.mask - Standard field mask for the set of fields to be updated.
* @param {object} params.resource - Request body data
* @param {callback} callback - The callback that handles the response.
* @return {object} Request object
*/
patch: function(params, callback) {
var parameters = {
options: {
url: 'https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}',
method: 'PATCH'
},
params: params,
requiredParams: ['appsId', 'servicesId', 'versionsId'],
pathParams: ['appsId', 'servicesId', 'versionsId'],
context: self
};
return createAPIRequest(parameters, callback);
}
}
}
};
}
/**
* Exports Appengine object
* @type Appengine
*/
module.exports = Appengine; | {
"content_hash": "802a498ca58f5bce56e079c37b57ec11",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 461,
"avg_line_length": 39.762962962962966,
"alnum_prop": 0.5942622950819673,
"repo_name": "AceS6/fire-gtfs",
"id": "eaf47740b7d6243b503ef983bd8c02921f98d9ff",
"size": "16721",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node_modules/googleapis/apis/appengine/v1beta5.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "39875"
}
],
"symlink_target": ""
} |
package com.microsoft.azure.management.compute.v2017_12_01;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* Defines values for CachingTypes.
*/
public enum CachingTypes {
/** Enum value None. */
NONE("None"),
/** Enum value ReadOnly. */
READ_ONLY("ReadOnly"),
/** Enum value ReadWrite. */
READ_WRITE("ReadWrite");
/** The actual serialized value for a CachingTypes instance. */
private String value;
CachingTypes(String value) {
this.value = value;
}
/**
* Parses a serialized value to a CachingTypes instance.
*
* @param value the serialized value to parse.
* @return the parsed CachingTypes object, or null if unable to parse.
*/
@JsonCreator
public static CachingTypes fromString(String value) {
CachingTypes[] items = CachingTypes.values();
for (CachingTypes item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}
@JsonValue
@Override
public String toString() {
return this.value;
}
}
| {
"content_hash": "fb0388928e0d24b4d3b198e9d3e706d5",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 74,
"avg_line_length": 23.76,
"alnum_prop": 0.6220538720538721,
"repo_name": "hovsepm/azure-sdk-for-java",
"id": "496fcf9213ad4d07596200bb6cc43573704bdbf3",
"size": "1418",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/CachingTypes.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "6821"
},
{
"name": "HTML",
"bytes": "1250"
},
{
"name": "Java",
"bytes": "103388992"
},
{
"name": "JavaScript",
"bytes": "8139"
},
{
"name": "PowerShell",
"bytes": "160"
},
{
"name": "Python",
"bytes": "3855"
},
{
"name": "Shell",
"bytes": "609"
}
],
"symlink_target": ""
} |
package com.github.cxfplus.com.sun.xml.bind.v2.runtime.unmarshaller;
import com.github.cxfplus.com.sun.xml.bind.util.AttributesImpl;
/**
* {@link AttributesEx} implementation.
*
* TODO: proper implementation that holds CharSequence
*
* @author Kohsuke Kawaguchi
*/
public final class AttributesExImpl extends AttributesImpl implements AttributesEx {
public CharSequence getData(int idx) {
return getValue(idx);
}
public CharSequence getData(String nsUri, String localName) {
return getValue(nsUri,localName);
}
}
| {
"content_hash": "e3309c8e1727c6c0d0450a50f7f9013f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 84,
"avg_line_length": 25.318181818181817,
"alnum_prop": 0.7342908438061041,
"repo_name": "xuse/cxf-plus",
"id": "000d7c01bd5030798c955e276ee381b49f7915f3",
"size": "2497",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/com/github/cxfplus/com/sun/xml/bind/v2/runtime/unmarshaller/AttributesExImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "2012"
},
{
"name": "Java",
"bytes": "3143681"
}
],
"symlink_target": ""
} |
import fs from 'fs';
export let source = "tainted";
| {
"content_hash": "9ee2ee831d2c7c40fc5cb2e31b308caa",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 30,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.6792452830188679,
"repo_name": "github/codeql",
"id": "ca11e038e957b1937dd5daa2a3eaa2da8a81342a",
"size": "53",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "javascript/ql/test/library-tests/InterProceduralFlow/esLib.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "3739"
},
{
"name": "Batchfile",
"bytes": "3534"
},
{
"name": "C",
"bytes": "410440"
},
{
"name": "C#",
"bytes": "21146000"
},
{
"name": "C++",
"bytes": "1352639"
},
{
"name": "CMake",
"bytes": "1809"
},
{
"name": "CodeQL",
"bytes": "32583145"
},
{
"name": "Dockerfile",
"bytes": "496"
},
{
"name": "EJS",
"bytes": "1478"
},
{
"name": "Emacs Lisp",
"bytes": "3445"
},
{
"name": "Go",
"bytes": "697562"
},
{
"name": "HTML",
"bytes": "58008"
},
{
"name": "Handlebars",
"bytes": "1000"
},
{
"name": "Java",
"bytes": "5417683"
},
{
"name": "JavaScript",
"bytes": "2432320"
},
{
"name": "Kotlin",
"bytes": "12163740"
},
{
"name": "Lua",
"bytes": "13113"
},
{
"name": "Makefile",
"bytes": "8631"
},
{
"name": "Mustache",
"bytes": "17025"
},
{
"name": "Nunjucks",
"bytes": "923"
},
{
"name": "Perl",
"bytes": "1941"
},
{
"name": "PowerShell",
"bytes": "1295"
},
{
"name": "Python",
"bytes": "1649035"
},
{
"name": "RAML",
"bytes": "2825"
},
{
"name": "Ruby",
"bytes": "299268"
},
{
"name": "Rust",
"bytes": "234024"
},
{
"name": "Shell",
"bytes": "23973"
},
{
"name": "Smalltalk",
"bytes": "23"
},
{
"name": "Starlark",
"bytes": "27062"
},
{
"name": "Swift",
"bytes": "204309"
},
{
"name": "Thrift",
"bytes": "3020"
},
{
"name": "TypeScript",
"bytes": "219623"
},
{
"name": "Vim Script",
"bytes": "1949"
},
{
"name": "Vue",
"bytes": "2881"
}
],
"symlink_target": ""
} |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.automation.generated;
import com.azure.core.util.Context;
/** Samples for DscConfiguration Delete. */
public final class DscConfigurationDeleteSamples {
/*
* x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/deleteDscConfiguration.json
*/
/**
* Sample code: Delete DSC Configuration.
*
* @param manager Entry point to AutomationManager.
*/
public static void deleteDSCConfiguration(com.azure.resourcemanager.automation.AutomationManager manager) {
manager.dscConfigurations().deleteWithResponse("rg", "myAutomationAccount33", "TemplateBasic", Context.NONE);
}
}
| {
"content_hash": "c09078c6d1192a6b86dc34dcc3c87138",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 144,
"avg_line_length": 39.5,
"alnum_prop": 0.7491369390103567,
"repo_name": "Azure/azure-sdk-for-java",
"id": "f64c169686b0c51d08a91fd802e26c73e3ebe567",
"size": "869",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/automation/azure-resourcemanager-automation/src/samples/java/com/azure/resourcemanager/automation/generated/DscConfigurationDeleteSamples.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "8762"
},
{
"name": "Bicep",
"bytes": "15055"
},
{
"name": "CSS",
"bytes": "7676"
},
{
"name": "Dockerfile",
"bytes": "2028"
},
{
"name": "Groovy",
"bytes": "3237482"
},
{
"name": "HTML",
"bytes": "42090"
},
{
"name": "Java",
"bytes": "432409546"
},
{
"name": "JavaScript",
"bytes": "36557"
},
{
"name": "Jupyter Notebook",
"bytes": "95868"
},
{
"name": "PowerShell",
"bytes": "737517"
},
{
"name": "Python",
"bytes": "240542"
},
{
"name": "Scala",
"bytes": "1143898"
},
{
"name": "Shell",
"bytes": "18488"
},
{
"name": "XSLT",
"bytes": "755"
}
],
"symlink_target": ""
} |
#import <Foundation/Foundation.h>
#import "GAILogger.h"
#import "GAITrackedViewController.h"
#import "GAITracker.h"
typedef NS_ENUM(NSUInteger, GAIDispatchResult) {
kGAIDispatchNoData,
kGAIDispatchGood,
kGAIDispatchError
};
/*! Google Analytics product string. */
extern NSString *const kGAIProduct;
/*! Google Analytics version string. */
extern NSString *const kGAIVersion;
/*!
NSError objects returned by the Google Analytics SDK may have this error domain
to indicate that the error originated in the Google Analytics SDK.
*/
extern NSString *const kGAIErrorDomain;
/*! Google Analytics error codes. */
typedef enum {
// This error code indicates that there was no error. Never used.
kGAINoError = 0,
// This error code indicates that there was a database-related error.
kGAIDatabaseError,
// This error code indicates that there was a network-related error.
kGAINetworkError,
} GAIErrorCode;
/*!
Google Analytics iOS top-level class. Provides facilities to create trackers
and set behaviorial flags.
*/
@interface GAI : NSObject
/*!
For convenience, this class exposes a default tracker instance.
This is initialized to `nil` and will be set to the first tracker that is
instantiated in trackerWithTrackingId:. It may be overridden as desired.
The GAITrackedViewController class will, by default, use this tracker instance.
*/
@property(nonatomic, assign) id<GAITracker> defaultTracker;
/*!
The GAILogger to use.
*/
@property(nonatomic, retain) id<GAILogger> logger;
/*!
When this is true, no tracking information will be gathered; tracking calls
will effectively become no-ops. When set to true, all tracking information that
has not yet been submitted. The value of this flag will be persisted
automatically by the SDK. Developers can optionally use this flag to implement
an opt-out setting in the app to allows users to opt out of Google Analytics
tracking.
This is set to `NO` the first time the Google Analytics SDK is used on a
device, and is persisted thereafter.
*/
@property(nonatomic, assign) BOOL optOut;
/*!
If this value is positive, tracking information will be automatically
dispatched every dispatchInterval seconds. Otherwise, tracking information must
be sent manually by calling dispatch.
By default, this is set to `120`, which indicates tracking information should
be dispatched automatically every 120 seconds.
*/
@property(nonatomic, assign) NSTimeInterval dispatchInterval;
/*!
When set to true, the SDK will record the currently registered uncaught
exception handler, and then register an uncaught exception handler which tracks
the exceptions that occurred using defaultTracker. If defaultTracker is not
`nil`, this function will track the exception on the tracker and attempt to
dispatch any outstanding tracking information for 5 seconds. It will then call
the previously registered exception handler, if any. When set back to false,
the previously registered uncaught exception handler will be restored.
*/
@property(nonatomic, assign) BOOL trackUncaughtExceptions;
/*!
When this is 'YES', no tracking information will be sent. Defaults to 'NO'.
*/
@property(nonatomic, assign) BOOL dryRun;
/*! Get the shared instance of the Google Analytics for iOS class. */
+ (GAI *)sharedInstance;
/*!
Creates or retrieves a GAITracker implementation with the specified name and
tracking ID. If the tracker for the specified name does not already exist, then
it will be created and returned; otherwise, the existing tracker will be
returned. If the existing tracker for the respective name has a different
tracking ID, that tracking ID is not changed by this method. If defaultTracker
is not set, it will be set to the tracker instance returned here.
@param name The name of this tracker. Must not be `nil` or empty.
@param trackingID The tracking ID to use for this tracker. It should be of
the form `UA-xxxxx-y`.
@return A GAITracker associated with the specified name. The tracker
can be used to send tracking data to Google Analytics. The first time this
method is called with a particular name, the tracker for that name will be
returned, and subsequent calls with the same name will return the same
instance. It is not necessary to retain the tracker because the tracker will be
retained internally by the library.
If an error occurs or the name is not valid, this method will return
`nil`.
*/
- (id<GAITracker>)trackerWithName:(NSString *)name
trackingId:(NSString *)trackingId;
/*!
Creates or retrieves a GAITracker implementation with name equal to
the specified tracking ID. If the tracker for the respective name does not
already exist, it is created, has it's tracking ID set to |trackingId|,
and is returned; otherwise, the existing tracker is returned. If the existing
tracker for the respective name has a different tracking ID, that tracking ID
is not changed by this method. If defaultTracker is not set, it is set to the
tracker instance returned here.
@param trackingID The tracking ID to use for this tracker. It should be of
the form `UA-xxxxx-y`. The name of the tracker will be the same as trackingID.
@return A GAITracker associated with the specified trackingID. The tracker
can be used to send tracking data to Google Analytics. The first time this
method is called with a particular trackingID, the tracker for the respective
name will be returned, and subsequent calls with the same trackingID
will return the same instance. It is not necessary to retain the tracker
because the tracker will be retained internally by the library.
If an error occurs or the trackingId is not valid, this method will return
`nil`.
*/
- (id<GAITracker>)trackerWithTrackingId:(NSString *)trackingId;
/*!
Remove a tracker from the trackers dictionary. If it is the default tracker,
clears the default tracker as well.
@param name The name of the tracker.
*/
- (void)removeTrackerByName:(NSString *)name;
/*!
Dispatches any pending tracking information.
Note that this does not have any effect on dispatchInterval, and can be used in
conjunction with periodic dispatch. */
- (void)dispatch;
/*!
Dispatches the next tracking beacon in the queue, calling completionHandler when
the tracking beacon has either been sent (returning kGAIDispatchGood) or an error has resulted
(returning kGAIDispatchError). If there is no network connection or there is no data to send,
kGAIDispatchNoData is returned.
Note that calling this method with a non-nil completionHandler disables periodic dispatch.
Periodic dispatch can be reenabled by setting the dispatchInterval to a positive number when
the app resumes from the background.
Calling this method with a nil completionHandler is the same as calling the dispatch
above.
This method can be used for background data fetching in iOS 7.0 or later. It would be wise to
call this when the application is exiting to initiate the submission of any unsubmitted
tracking information.
@param completionHandler The block to run after a single dispatch request. The GAIDispatchResult
param indicates whether the dispatch succeeded, had an error, or had no hits to dispatch.
*/
- (void)dispatchWithCompletionHandler:(void (^)(GAIDispatchResult result))completionHandler;
@end
| {
"content_hash": "c93fb69a18eea90b13b21fb68ca3ecbb",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 97,
"avg_line_length": 39.149732620320854,
"alnum_prop": 0.7765332604835405,
"repo_name": "alsnkline/DD-s-Dictionary_3.x",
"id": "b0e49522ad70196221023d00a5ed7a5e2ec28b07",
"size": "7467",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "DD-s-Dictionary/GAI.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1031"
},
{
"name": "HTML",
"bytes": "4143"
},
{
"name": "Objective-C",
"bytes": "270240"
},
{
"name": "Objective-C++",
"bytes": "28305"
}
],
"symlink_target": ""
} |
FROM balenalib/jetson-nano-alpine:3.11-run
# Default to UTF-8 file.encoding
ENV LANG C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
RUN { \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
RUN set -x \
&& apk add --no-cache \
openjdk8 \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Alpine Linux 3.11 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nOpenJDK v8-jdk \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& ln -f /bin/sh /bin/sh.real \
&& ln -f /bin/sh-shim /bin/sh | {
"content_hash": "b53e83358d2b6b73a353dfcdd99df587",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 681,
"avg_line_length": 57.833333333333336,
"alnum_prop": 0.699135446685879,
"repo_name": "nghiant2710/base-images",
"id": "e4f6d9f29b7d4af88a633773b60176c3f3317459",
"size": "1756",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/openjdk/jetson-nano/alpine/3.11/8-jdk/run/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "144558581"
},
{
"name": "JavaScript",
"bytes": "16316"
},
{
"name": "Shell",
"bytes": "368690"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en" ng-app="demoApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html lang="en" ng-app="demoApp" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html lang="en" ng-app="demoApp" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en" ng-app="demoApp" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Graph demo app</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/normalize.css">
<link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/main.css">
<link rel="stylesheet" href="app.css">
<link href="//cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/foundation.css" rel="stylesheet">
<script src="bower_components/html5-boilerplate/dist/js/vendor/modernizr-2.8.3.min.js"></script>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/maps/modules/map.src.js"></script>
<script src="https://code.highcharts.com/maps/modules/data.js"></script>
<script src="https://code.highcharts.com/mapdata/countries/ca/ca-all.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div>
<top-bar>
<ul class="title-area">
<li class="name">
<h1><a href="#">Highcharts demos</a></h1>
</li>
<li toggle-top-bar class="menu-icon"><a href="#">Menu</a></li>
</ul>
<top-bar-section>
<!-- Right Nav Section -->
<ul class="right">
<li has-dropdown>
<a href="#">Links</a>
<ul top-bar-dropdown>
<li><a href="https://angularjs.org/" target="_blank">Angular</a></li>
<li><a href="http://www.highcharts.com/" target="_blank">Highcharts</a></li>
<li><a href="http://foundation.zurb.com/sites/docs/" target="_blank">Zurb foundation</a></li>
</ul>
</li>
</ul>
<!-- Left Nav Section -->
<ul class="left">
<li ui-sref-active="active"><a ui-sref="highcharts">Highcharts</a></li>
<li ui-sref-active="active"><a ui-sref="highstock">Highstock</a></li>
<li ui-sref-active="active"><a ui-sref="highmaps">Highmaps</a></li>
</ul>
</top-bar-section>
</top-bar>
</div>
<main ui-view></main>
<!-- Github page -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.2/angular-ui-router.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-foundation/0.8.0/mm-foundation-tpls.js"></script>
<!--
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
<script src="bower_components/angular-foundation/mm-foundation-tpls.js"></script>
-->
<script src="app.js"></script>
<script src="directives/hcPlot.js"></script>
<script src="modules/highcharts.js"></script>
<script src="modules/highstock.js"></script>
<script src="modules/highmaps.js"></script>
</body>
</html>
| {
"content_hash": "d3ac39a5d692f40db1febda9297fd914",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 178,
"avg_line_length": 44.3625,
"alnum_prop": 0.6193293885601578,
"repo_name": "yllieth/demo-angular-highcharts",
"id": "2638d4a17b79863ac195f5acf261028cef9e560f",
"size": "3549",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "659"
},
{
"name": "HTML",
"bytes": "13500"
},
{
"name": "JavaScript",
"bytes": "110730"
}
],
"symlink_target": ""
} |
package org.apache.flink.table.plan.schema
import org.apache.flink.table.`type`.InternalType
import org.apache.flink.table.functions
import org.apache.calcite.rel.`type`.{RelDataType, RelDataTypeFactory}
import org.apache.calcite.schema.{FunctionParameter, TableFunction}
import java.lang.reflect.Type
import java.util
import java.util.Collections
/**
* A [[FlinkTableFunction]] is an implementation of [[org.apache.calcite.schema.TableFunction]].
* It is also an abstraction and instance holder of Table Function in Flink's Table API & SQL.
* We can create different kinds of [[FlinkTableFunction]] for different usages.
*
* @param tableFunction The Table Function instance
*/
abstract class FlinkTableFunction(
tableFunction: functions.TableFunction[_])
extends TableFunction {
override def getElementType(arguments: util.List[AnyRef]): Type = classOf[Array[Object]]
// we do never use the FunctionParameters, so return an empty list
override def getParameters: util.List[FunctionParameter] = Collections.emptyList()
// we do never use the getRowType, so return null
override def getRowType(
typeFactory: RelDataTypeFactory,
arguments: util.List[AnyRef]): RelDataType = null
/**
* Returns the Type for usage, i.e. code generation.
*/
def getExternalResultType(
arguments: Array[AnyRef],
argTypes: Array[Class[_]]): InternalType
def getRowType(
typeFactory: RelDataTypeFactory,
arguments: Array[AnyRef],
argTypes: Array[Class[_]]): RelDataType
}
| {
"content_hash": "c1b5464e130ed5b10680de892b4dad35",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 98,
"avg_line_length": 34.24444444444445,
"alnum_prop": 0.7443218689162882,
"repo_name": "ueshin/apache-flink",
"id": "7c205e372c890f297211f9cadb3caa4395a81523",
"size": "2346",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/FlinkTableFunction.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5667"
},
{
"name": "CSS",
"bytes": "18100"
},
{
"name": "Clojure",
"bytes": "88796"
},
{
"name": "CoffeeScript",
"bytes": "91220"
},
{
"name": "Dockerfile",
"bytes": "9788"
},
{
"name": "HTML",
"bytes": "86821"
},
{
"name": "Java",
"bytes": "42052018"
},
{
"name": "JavaScript",
"bytes": "8267"
},
{
"name": "Python",
"bytes": "249644"
},
{
"name": "Scala",
"bytes": "8365242"
},
{
"name": "Shell",
"bytes": "398033"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>chapar: 11 m 18 s 🏆</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.11.1 / chapar - 8.12.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
chapar
<small>
8.12.0
<span class="label label-success">11 m 18 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-05 16:11:41 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-05 16:11:41 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.11.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.10.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.2 Official release 4.10.2
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/coq-community/chapar"
dev-repo: "git+https://github.com/coq-community/chapar.git"
bug-reports: "https://github.com/coq-community/chapar/issues"
license: "MIT"
synopsis: "A framework for verification of causal consistency for distributed key-value stores and their clients in Coq"
description: """
A framework for modular verification of causal consistency for replicated key-value
store implementations and their client programs in Coq. Includes proofs of the causal consistency
of two key-value store implementations and a simple automatic model checker for the correctness
of client programs."""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.10" & < "8.13~"}
]
tags: [
"category:Computer Science/Concurrent Systems and Protocols/Theory of concurrent systems"
"keyword:causal consistency"
"keyword:key-value stores"
"keyword:distributed algorithms"
"keyword:program verification"
"logpath:Chapar"
"date:2020-10-01"
]
authors: [
"Mohsen Lesani"
"Christian J. Bell"
"Adam Chlipala"
]
url {
src: "https://github.com/coq-community/chapar/archive/v8.12.0.tar.gz"
checksum: "sha512=3015fa85c49e25a71317ec9999fd0e77df41e3a969958913499f28c0dcdcd9e4d40fca694591032e58c4f071f9e0a1082fdb42edabce0fee06621f7f09e879b7"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-chapar.8.12.0 coq.8.11.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-chapar.8.12.0 coq.8.11.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>12 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-chapar.8.12.0 coq.8.11.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>11 m 18 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 8 M</p>
<ul>
<li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Framework/KVStore.vo</code></li>
<li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/KVSAlg2.vo</code></li>
<li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Examples/Clients.vo</code></li>
<li>1 M <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Examples/ListClient.vo</code></li>
<li>643 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/KVSAlg3.vo</code></li>
<li>570 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/KVSAlg1.vo</code></li>
<li>442 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Framework/KVStore.glob</code></li>
<li>380 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Framework/ReflectiveAbstractSemantics.vo</code></li>
<li>289 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/KVSAlg2.glob</code></li>
<li>194 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Framework/KVStore.v</code></li>
<li>194 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Framework/ReflectiveAbstractSemantics.glob</code></li>
<li>168 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/KVSAlg3.glob</code></li>
<li>165 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/KVSAlg2.v</code></li>
<li>131 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/KVSAlg1.glob</code></li>
<li>85 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/KVSAlg3.v</code></li>
<li>63 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/KVSAlg1.v</code></li>
<li>48 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Framework/ReflectiveAbstractSemantics.v</code></li>
<li>37 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Lib/Predefs.vo</code></li>
<li>34 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Lib/extralib.vo</code></li>
<li>25 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/ExtractAlgorithm.vo</code></li>
<li>21 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Examples/Clients.glob</code></li>
<li>16 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Lib/Predefs.glob</code></li>
<li>14 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Examples/ListClient.glob</code></li>
<li>9 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Lib/extralib.glob</code></li>
<li>7 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Examples/Clients.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Lib/Predefs.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Examples/ListClient.v</code></li>
<li>3 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Lib/extralib.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/ExtractAlgorithm.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/Chapar/Algorithms/ExtractAlgorithm.glob</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-chapar.8.12.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "f8dceccacd4f31a126cb009ba4b803a0",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 159,
"avg_line_length": 53.843434343434346,
"alnum_prop": 0.5883125410374261,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "e2931300f74335ea19e83888600cecbed70f1163",
"size": "10686",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.10.2-2.0.6/released/8.11.1/chapar/8.12.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Wed Jul 17 13:50:50 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.wildfly.swarm.config.management.security_realm.TruststoreAuthentication (BOM: * : All 2.5.0.Final API)</title>
<meta name="date" content="2019-07-17">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.wildfly.swarm.config.management.security_realm.TruststoreAuthentication (BOM: * : All 2.5.0.Final API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.5.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/management/security_realm/class-use/TruststoreAuthentication.html" target="_top">Frames</a></li>
<li><a href="TruststoreAuthentication.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.wildfly.swarm.config.management.security_realm.TruststoreAuthentication" class="title">Uses of Class<br>org.wildfly.swarm.config.management.security_realm.TruststoreAuthentication</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.management">org.wildfly.swarm.config.management</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.management.security_realm">org.wildfly.swarm.config.management.security_realm</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config.management">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a> in <a href="../../../../../../../org/wildfly/swarm/config/management/package-summary.html">org.wildfly.swarm.config.management</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/management/package-summary.html">org.wildfly.swarm.config.management</a> that return <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a></code></td>
<td class="colLast"><span class="typeNameLabel">SecurityRealm.SecurityRealmResources.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/SecurityRealm.SecurityRealmResources.html#truststoreAuthentication--">truststoreAuthentication</a></span>()</code>
<div class="block">Configuration of a keystore to use to create a trust manager to
verify clients.</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/management/package-summary.html">org.wildfly.swarm.config.management</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/management/SecurityRealm.html" title="type parameter in SecurityRealm">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">SecurityRealm.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/SecurityRealm.html#truststoreAuthentication-org.wildfly.swarm.config.management.security_realm.TruststoreAuthentication-">truststoreAuthentication</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a> value)</code>
<div class="block">Configuration of a keystore to use to create a trust manager to verify
clients.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.wildfly.swarm.config.management.security_realm">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a> in <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/package-summary.html">org.wildfly.swarm.config.management.security_realm</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/package-summary.html">org.wildfly.swarm.config.management.security_realm</a> with type parameters of type <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a><T>></span></code>
<div class="block">Configuration of a keystore to use to create a trust manager to verify
clients.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthenticationConsumer.html" title="interface in org.wildfly.swarm.config.management.security_realm">TruststoreAuthenticationConsumer</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a><T>></span></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthenticationSupplier.html" title="interface in org.wildfly.swarm.config.management.security_realm">TruststoreAuthenticationSupplier</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a>></span></code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/package-summary.html">org.wildfly.swarm.config.management.security_realm</a> that return <a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a></code></td>
<td class="colLast"><span class="typeNameLabel">TruststoreAuthenticationSupplier.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthenticationSupplier.html#get--">get</a></span>()</code>
<div class="block">Constructed instance of TruststoreAuthentication resource</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/wildfly/swarm/config/management/security_realm/TruststoreAuthentication.html" title="class in org.wildfly.swarm.config.management.security_realm">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.5.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/management/security_realm/class-use/TruststoreAuthentication.html" target="_top">Frames</a></li>
<li><a href="TruststoreAuthentication.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "e389d4c750e9bb393f88068811169792",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 555,
"avg_line_length": 60.723404255319146,
"alnum_prop": 0.6873160476524176,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "319e307ac7da2071e279526822bc66512ea17d98",
"size": "14270",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.5.0.Final/apidocs/org/wildfly/swarm/config/management/security_realm/class-use/TruststoreAuthentication.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package shift;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@WebServlet("/UserNameEdit")
public class UserNameEdit extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
perform(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
perform(request, response);
}
protected void perform(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html; charset=UTF-8");
PrintWriter out = response.getWriter();
int userId;
String param = request.getParameter("USERID");
if (param == null || param.length() == 0) {
userId = -1;
} else {
try {
userId = Integer.parseInt(param);
} catch (NumberFormatException e) {
userId = -1;
}
}
if (userId == -1) {
response.sendRedirect("/ShiftApplication/UserNotExist.html");
}
Connection con = null;
Statement smt = null;
ResultSet rs = null;
String userName = null;
String sql = "select * from usertable where id = '" + userId + "'";
try {
con = ConnectionManager.getConnection();
smt = con.createStatement();
rs = smt.executeQuery(sql);
rs.next();
userName = rs.getString("user");
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (rs != null) {
try {
rs.close();
} catch (Exception ignore) {
}
}
if (smt != null) {
try {
smt.close();
} catch (Exception ignore) {
}
}
if (con != null) {
try {
con.close();
} catch (Exception ignore) {
}
}
}
StringBuffer sb = new StringBuffer();
sb.append("<!DOCTYPE html PUBLIC \"-//W3C/DTD HTML 4.0.1//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">");
sb.append("<html lang=\"java\">");
sb.append("<head>");
sb.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"/ShiftApplication/css/Servlet.css\">");
sb.append("<meta http-equiv=\"Content-Type\" Content=\"text/html; charset=UTF-8\">");
sb.append("<title>ユーザー名変更ページ</title>");
sb.append("</head>");
sb.append("<body>");
sb.append("<div style=\"text-align:center\">");
sb.append("<p style=\"font-size:1.2em;\">ユーザー名変更ページ");
sb.append("</p>");
sb.append("<span class=\"small\" style=\"color:#ffffff;\">以下のユーザーの名前を変更できます</span>");
HttpSession session = request.getSession(false);
Object status = session.getAttribute("UserNameUpdate");
if (status != null) {
String statusStr = (String) status;
if (statusStr.equals("Fail")) {
sb.append("<div class=\"session\" style=\"color:#dc143c\">");
sb.append("<p>ユーザー名の変更に失敗しました</p>");
sb.append("</div>");
}
session.setAttribute("UserNameUpdate", null);
}
sb.append("<form method=\"post\" name=\"loginform\" action=\"/ShiftApplication/UserNameUpdate?USERID=");
sb.append(userId);
sb.append("\">");
sb.append("<br>");
sb.append("<table align=\"center\" style=\"width:350px;\">");
sb.append("<tr>");
sb.append("<td style=\"font-size:0.75em;\">ユーザー名</td>");
sb.append("<td><input type=\"text\" name=\"user\" size=\"32\" value=\"");
sb.append(userName);
sb.append("\">");
sb.append("</td>");
sb.append("</tr>");
sb.append("</table>");
sb.append("<br>");
sb.append(" ");
sb.append("<input class=\"button\" style=\"height:32px; line-height:28px;\" type=\"submit\" value=\"変更する\">");
sb.append(" ");
sb.append("<input class=\"button\" style=\"height:32px; line-height:28px;\" type=\"reset\" value=\"入力し直す\">");
sb.append(" ");
sb.append("</form>");
sb.append("<br>");
sb.append("<br>");
sb.append("<span class=\"small\"><a class=\"button\" href=\"/ShiftApplication/Management\">管理者ページヘ</a></span>");
sb.append(" ");
sb.append("<span class=\"small\"><a class=\"button\" href=\"Index.html\">トップページへ</a></span>");
sb.append("</div>");
sb.append("</body>");
sb.append("</html>");
out.println(new String(sb));
}
}
| {
"content_hash": "76d4c07f5a32c69170891669c231121e",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 114,
"avg_line_length": 27.850299401197606,
"alnum_prop": 0.6200817028596001,
"repo_name": "Rui-6515/SMART",
"id": "ae819be893fc1d533ce38536514fe7111d397ae3",
"size": "4811",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/shift/UserNameEdit.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9119"
},
{
"name": "Java",
"bytes": "242717"
}
],
"symlink_target": ""
} |
package org.wso2.siddhi.core.query.output.ratelimit.snapshot;
import org.wso2.siddhi.core.event.ComplexEvent;
import org.wso2.siddhi.core.event.ComplexEventChunk;
import org.wso2.siddhi.core.event.MetaComplexEvent;
import org.wso2.siddhi.core.event.state.MetaStateEvent;
import org.wso2.siddhi.core.event.state.StateEventCloner;
import org.wso2.siddhi.core.event.state.StateEventPool;
import org.wso2.siddhi.core.event.stream.MetaStreamEvent;
import org.wso2.siddhi.core.event.stream.StreamEventCloner;
import org.wso2.siddhi.core.event.stream.StreamEventPool;
import org.wso2.siddhi.core.query.output.ratelimit.OutputRateLimiter;
import org.wso2.siddhi.core.query.selector.attribute.processor.AttributeProcessor;
import org.wso2.siddhi.core.query.selector.attribute.processor.executor.AbstractAggregationAttributeExecutor;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ScheduledExecutorService;
public class WrappedSnapshotOutputRateLimiter extends OutputRateLimiter {
SnapshotOutputRateLimiter outputRateLimiter;
private String id;
private final Long value;
private final ScheduledExecutorService scheduledExecutorService;
private final boolean groupBy;
private final boolean windowed;
private List<Integer> aggregateAttributePositionList = new ArrayList<Integer>();
public WrappedSnapshotOutputRateLimiter(String id, Long value, ScheduledExecutorService scheduledExecutorService, boolean isGroupBy, boolean isWindowed) {
this.id = id;
this.value = value;
this.scheduledExecutorService = scheduledExecutorService;
groupBy = isGroupBy;
windowed = isWindowed;
}
@Override
public OutputRateLimiter clone(String key) {
WrappedSnapshotOutputRateLimiter wrappedSnapshotOutputRateLimiter = new WrappedSnapshotOutputRateLimiter(id + key, value, scheduledExecutorService, groupBy, windowed);
wrappedSnapshotOutputRateLimiter.outputRateLimiter = this.outputRateLimiter.clone(key, wrappedSnapshotOutputRateLimiter);
wrappedSnapshotOutputRateLimiter.setLatencyTracker(latencyTracker);
return wrappedSnapshotOutputRateLimiter;
}
public void init(int outPutAttributeSize, List<AttributeProcessor> attributeProcessorList, MetaComplexEvent metaComplexEvent) {
for (AttributeProcessor attributeProcessor : attributeProcessorList) {
if (attributeProcessor.getExpressionExecutor() instanceof AbstractAggregationAttributeExecutor) {
aggregateAttributePositionList.add(attributeProcessor.getOutputPosition());
}
}
if (windowed) {
if (groupBy) {
if (outPutAttributeSize == aggregateAttributePositionList.size()) { //All Aggregation
outputRateLimiter = new AllAggregationGroupByWindowedPerSnapshotOutputRateLimiter(id, value, scheduledExecutorService, this);
} else if (aggregateAttributePositionList.size() > 0) { //Some Aggregation
outputRateLimiter = new AggregationGroupByWindowedPerSnapshotOutputRateLimiter(id, value, scheduledExecutorService, aggregateAttributePositionList, this);
} else { // No aggregation
//GroupBy is same as Non GroupBy
outputRateLimiter = new WindowedPerSnapshotOutputRateLimiter(id, value, scheduledExecutorService, this);
}
} else {
if (outPutAttributeSize == aggregateAttributePositionList.size()) { //All Aggregation
outputRateLimiter = new AllAggregationPerSnapshotOutputRateLimiter(id, value, scheduledExecutorService, this);
} else if (aggregateAttributePositionList.size() > 0) { //Some Aggregation
outputRateLimiter = new AggregationWindowedPerSnapshotOutputRateLimiter(id, value, scheduledExecutorService, aggregateAttributePositionList, this);
} else { // No aggregation
outputRateLimiter = new WindowedPerSnapshotOutputRateLimiter(id, value, scheduledExecutorService, this);
}
}
} else {
if (groupBy) {
outputRateLimiter = new GroupByPerSnapshotOutputRateLimiter(id, value, scheduledExecutorService, this);
} else {
outputRateLimiter = new PerSnapshotOutputRateLimiter(id, value, scheduledExecutorService, this);
}
}
if (metaComplexEvent instanceof MetaStateEvent) {
StateEventPool stateEventPool = new StateEventPool((MetaStateEvent) metaComplexEvent, 5);
outputRateLimiter.setStateEventCloner(new StateEventCloner((MetaStateEvent) metaComplexEvent, stateEventPool));
} else {
StreamEventPool streamEventPool = new StreamEventPool((MetaStreamEvent) metaComplexEvent, 5);
outputRateLimiter.setStreamEventCloner(new StreamEventCloner((MetaStreamEvent) metaComplexEvent, streamEventPool));
}
}
@Override
public void start() {
outputRateLimiter.start();
}
@Override
public void stop() {
outputRateLimiter.stop();
}
@Override
public void process(ComplexEventChunk complexEventChunk) {
outputRateLimiter.process(complexEventChunk);
}
public void passToCallBacks(ComplexEventChunk complexEventChunk) {
sendToCallBacks(complexEventChunk);
}
@Override
public Object[] currentState() {
return outputRateLimiter.currentState();
}
@Override
public void restoreState(Object[] state) {
outputRateLimiter.restoreState(state);
}
}
| {
"content_hash": "608bd2e5a9f368bb288aac8b72c8812e",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 175,
"avg_line_length": 46.073170731707314,
"alnum_prop": 0.7238397741309335,
"repo_name": "rajeev3001/siddhi",
"id": "f19715f3906de40b591d8fbed8fbd5d6424285c1",
"size": "6340",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "modules/siddhi-core/src/main/java/org/wso2/siddhi/core/query/output/ratelimit/snapshot/WrappedSnapshotOutputRateLimiter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "8961"
},
{
"name": "CSS",
"bytes": "2652"
},
{
"name": "GAP",
"bytes": "42178"
},
{
"name": "Java",
"bytes": "2501687"
}
],
"symlink_target": ""
} |
package info.slony.clustertest.testcoordinator;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.FileInputStream;
import java.io.Reader;
import java.util.Properties;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.EcmaError;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
public class TestCoordinator {
private static Logger log = Logger.getLogger(TestCoordinator.class);
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
// Set up a simple configuration that logs on the console.
try {
Class.forName("org.postgresql.Driver");
String propertiesFileName = args[0];
TestCoordinator me = new TestCoordinator();
FileReader reader = new FileReader(propertiesFileName);
Properties props = new Properties();
props.load(reader);
String log4jConf = props.getProperty("log4j.conf");
if(log4jConf != null) {
PropertyConfigurator.configure(log4jConf);
}
String outputDirectoryName = props.getProperty("output.directory");
File outputDirectory = new File(outputDirectoryName);
outputDirectory.mkdirs();
TestResult results = new TestResult("test", outputDirectoryName);
log.info("Launching a set of tests");
for(int idx = 1; idx < args.length; idx++) {
String testScript = args[idx];
log.info("Starting test script " + testScript);
me.executeTestScript(args[idx],results, props);
}
results.close();
}
catch(IOException e) {
log.error("error setting up test run",e);
}
catch(ClassNotFoundException e) {
log.error("can not load jdbc driver",e);
}
}
protected void executeTestScript(String scriptFile, TestResult results,Properties properties) {
Coordinator coordinator=null;
try {
Context ctx = Context.enter();
Scriptable scope = ctx.initStandardObjects();
coordinator = new Coordinator(scope,ctx,properties);
InputStream scriptStream = new FileInputStream(scriptFile);
//ClassLoader.getSystemResourceAsStream(scriptFile);
if(scriptStream==null) {
log.error("unable to find test script:" + scriptFile);
return;
}
Reader scriptReader = new InputStreamReader(scriptStream);
Object wrappedOut = Context.javaToJS(coordinator, scope);
ScriptableObject.putProperty(scope, "coordinator", wrappedOut);
wrappedOut = Context.javaToJS(results,scope);
ScriptableObject.putProperty(scope,"results",wrappedOut);
wrappedOut = Context.javaToJS(properties,scope);
ScriptableObject.putProperty(scope,"properties",wrappedOut);
ctx.evaluateReader(scope, scriptReader, scriptFile, 0, null);
results.testComplete();
}
catch(IOException e) {
log.error("error reading script",e);
coordinator.abortTest(e.getMessage());
}
catch(EcmaError e) {
log.error("error from script",e);
e.printStackTrace();
coordinator.abortTest(e.getMessage());
}
finally {
if(coordinator != null) {
coordinator.shutdown();
}
}
}
}
| {
"content_hash": "7b0d8d6e2f6531ee488b677bea8fa9a2",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 96,
"avg_line_length": 29.381818181818183,
"alnum_prop": 0.7196782178217822,
"repo_name": "clustertest/clustertest-framework",
"id": "b3c21a4f6d4674b182639e825274071df5b2b0f4",
"size": "3232",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/info/slony/clustertest/testcoordinator/TestCoordinator.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "136996"
},
{
"name": "JavaScript",
"bytes": "3363"
}
],
"symlink_target": ""
} |
Each ejs template in this folder will be rendered. To render the template use the following command:
```sh
node ./docs/scripts/review_templates.js
```
The result is going to be files created in the docs folder.
| {
"content_hash": "921c778df1463cb24754e93e6fc7ffca",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 100,
"avg_line_length": 30.428571428571427,
"alnum_prop": 0.7652582159624414,
"repo_name": "vue-styleguidist/vue-styleguidist",
"id": "793903c777e7bdd37861becb776837322f58afa2",
"size": "257",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "docs/templates/ReadMe.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "EJS",
"bytes": "2298"
},
{
"name": "HTML",
"bytes": "968"
},
{
"name": "JavaScript",
"bytes": "89449"
},
{
"name": "Shell",
"bytes": "1382"
},
{
"name": "TypeScript",
"bytes": "672613"
},
{
"name": "Vue",
"bytes": "32498"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>atbr: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.8.1 / atbr - 8.10.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
atbr
<small>
8.10.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-11 21:19:47 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-11 21:19:47 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.8.1 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/coq-community/atbr"
dev-repo: "git+https://github.com/coq-community/atbr.git"
bug-reports: "https://github.com/coq-community/atbr/issues"
license: "LGPL-3.0-or-later"
synopsis: "A Coq tactic for deciding Kleene algebras"
description: """
This library provides algebraic tools for working with binary relations.
The main tactic provided is a reflexive tactic for solving (in)equations
in an arbitrary Kleene algebra. The decision procedure goes through
standard finite automata constructions.
Note that the initial authors consider this library to be superseded
by the Relation Algebra library, which is based on derivatives
rather than automata: https://github.com/damien-pous/relation-algebra"""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"ocaml"
"coq" {>= "8.10" & < "8.11~"}
]
tags: [
"category:Miscellaneous/Coq Extensions"
"category:Computer Science/Decision Procedures and Certified Algorithms/Decision procedures"
"keyword:Kleene algebra"
"keyword:finite automata"
"keyword:semiring"
"keyword:matrices"
"keyword:decision procedure"
"keyword:reflexive tactic"
"logpath:ATBR"
"date:2019-12-07"
]
authors: [
"Thomas Braibant"
"Damien Pous"
]
url {
src: "https://github.com/coq-community/atbr/archive/v8.10.0.tar.gz"
checksum: "sha512=8730fce6afc28f70b5e4f83c8bd041962aeff186f75ea49c0f742a9260afd1024f2f018b438594bac1af522da68621e9676b15895542f59ea7603cf4d0639791"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-atbr.8.10.0 coq.8.8.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.8.1).
The following dependencies couldn't be met:
- coq-atbr -> coq >= 8.10 -> ocaml >= 4.09.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-atbr.8.10.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "3bf2da3b242515a48f709ee6d2489768",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 159,
"avg_line_length": 41.44565217391305,
"alnum_prop": 0.5670076055599266,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "26e3d5f50a820541c9b4210b0ee5045ac28f3102",
"size": "7651",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.8.1/atbr/8.10.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
namespace XamarinShot.Models.Formattings
{
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SceneKit;
public class PhysicsNodeDataFormatting : JsonConverter<PhysicsNodeData>
{
public override bool CanRead => true;
public override PhysicsNodeData ReadJson(JsonReader reader, Type objectType, PhysicsNodeData existingValue, bool hasExistingValue, JsonSerializer serializer)
{
var result = default(PhysicsNodeData);
if (reader.TokenType != JsonToken.Null)
{
result = new PhysicsNodeData();
var jsonObject = JObject.Load(reader);
result.IsAlive = jsonObject[(nameof(result.IsAlive))].Value<bool>();
if(result.IsAlive)
{
result.IsMoving = jsonObject[nameof(result.IsAlive)].Value<bool>();
result.Team = (Team)jsonObject[nameof(result.Team)].Value<int>();
result.Position = jsonObject[nameof(result.Position)].ToObject<SCNVector3>(serializer);
result.Orientation = jsonObject[(nameof(result.Orientation))].ToObject<SCNQuaternion>(serializer);
if (result.IsMoving)
{
result.Velocity = jsonObject[nameof(result.Velocity)]?.ToObject<SCNVector3>(serializer) ?? SCNVector3.Zero;
result.AngularVelocity = jsonObject[nameof(result.AngularVelocity)]?.ToObject<SCNVector4>(serializer) ?? SCNVector4.Zero;
}
}
}
return result;
}
public override void WriteJson(JsonWriter writer, PhysicsNodeData value, JsonSerializer serializer)
{
var jsonObject = new JObject();
jsonObject.Add(nameof(value.IsAlive), JToken.FromObject(value.IsAlive, serializer));
if (value.IsAlive)
{
jsonObject.Add(nameof(value.IsMoving), JToken.FromObject(value.IsMoving, serializer));
jsonObject.Add(nameof(value.Team), JToken.FromObject(value.Team, serializer));
jsonObject.Add(nameof(value.Position), JToken.FromObject(value.Position, serializer));
jsonObject.Add(nameof(value.Orientation), JToken.FromObject(value.Orientation, serializer));
if (value.IsMoving)
{
jsonObject.Add(nameof(value.Velocity), JToken.FromObject(value.Velocity, serializer));
jsonObject.Add(nameof(value.AngularVelocity), JToken.FromObject(value.AngularVelocity, serializer));
}
}
jsonObject.WriteTo(writer);
}
}
}
| {
"content_hash": "e932e033170c499bacf5d6f7e3350685",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 166,
"avg_line_length": 43.3968253968254,
"alnum_prop": 0.60424286759327,
"repo_name": "xamarin/monotouch-samples",
"id": "8d8dbbb4d46c75ba6c2ef8332bf2f5decbe7e4a6",
"size": "2736",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ios12/XamarinShot/XamarinShot/Core/Local Networking/Formattings/PhysicsNodeDataFormatting.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "5568672"
},
{
"name": "F#",
"bytes": "11402"
},
{
"name": "GLSL",
"bytes": "13657"
},
{
"name": "HTML",
"bytes": "9912"
},
{
"name": "Makefile",
"bytes": "16378"
},
{
"name": "Metal",
"bytes": "4299"
},
{
"name": "Objective-C",
"bytes": "106014"
},
{
"name": "Shell",
"bytes": "6235"
}
],
"symlink_target": ""
} |
import { Expansion as CoffeeExpansion } from 'decaffeinate-coffeescript2/lib/coffeescript/nodes.js';
import { Expansion } from '../nodes';
import getLocation from '../util/getLocation';
import ParseContext from '../util/ParseContext';
export default function mapExpansion(
context: ParseContext,
node: CoffeeExpansion
): Expansion {
const { line, column, start, end, raw } = getLocation(context, node);
return new Expansion(line, column, start, end, raw);
}
| {
"content_hash": "029a78100c98a27b3eefa4450ca24072",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 100,
"avg_line_length": 38.916666666666664,
"alnum_prop": 0.7451820128479657,
"repo_name": "decaffeinate/decaffeinate-parser",
"id": "4245eb22c66eed8edd8370f51e3ea1a4a3dd7c42",
"size": "467",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/mappers/mapExpansion.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "4985"
},
{
"name": "JavaScript",
"bytes": "231"
},
{
"name": "Shell",
"bytes": "74"
},
{
"name": "TypeScript",
"bytes": "167488"
}
],
"symlink_target": ""
} |
using System;
namespace Wasm
{
/// <summary>
/// The type of exception that is thrown when an invalid header is detected.
/// </summary>
public sealed class BadHeaderException : WasmException
{
/// <summary>
/// Initializes a new instance of the <see cref="BadHeaderException"/> class.
/// </summary>
/// <param name="header">The version header.</param>
/// <param name="message">The error message.</param>
public BadHeaderException(VersionHeader header, string message)
: base(message)
{
this.Header = header;
}
/// <summary>
/// Gets the erroneous version header.
/// </summary>
/// <value>The version header.</value>
public VersionHeader Header { get; private set; }
}
}
| {
"content_hash": "e64ba25734d281411c83a75bfa5728ee",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 85,
"avg_line_length": 30.703703703703702,
"alnum_prop": 0.5778045838359469,
"repo_name": "jonathanvdc/cs-wasm",
"id": "9276ba6936aeeea7141631a079091df8acf7cfc4",
"size": "831",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libwasm/BadHeaderException.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "864333"
},
{
"name": "Makefile",
"bytes": "434"
},
{
"name": "Python",
"bytes": "510"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
namespace MVC.SinglePage.Data
{
public class TrainingProduct
{
public int ProductId { get; set; }
[Required(ErrorMessage = "Product Name must be filled in")]
[Display(Description = "Product Name")]
[StringLength(150, MinimumLength = 4, ErrorMessage = "Product Name must be greater than {2} characters and less than {1} characters.")]
public string ProductName { get; set; }
[Range(typeof(DateTime), "1/1/2000", "12/31/2020", ErrorMessage = "Introduction Date must be between {1} and {2}")]
[Display(Description = "Introduction Date")]
public DateTime IntroductionDate { get; set; }
[Required(ErrorMessage = "URL must be filled in")]
[Display(Description = "URL")]
[StringLength(150, MinimumLength = 5, ErrorMessage = "URL must be greater than {2} characters and less than {1} characters.")]
public string Url { get; set; }
[Range(1, 9999, ErrorMessage = "{0} must be between {1} and {2}")]
public decimal Price { get; set; }
}
}
| {
"content_hash": "997246ccc998369966e619dfaea8952c",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 143,
"avg_line_length": 45.03703703703704,
"alnum_prop": 0.6603618421052632,
"repo_name": "trungk18/mvc5-crud-on-single-page-with-razor-mvvm",
"id": "abe9d0c8757409eacbad02686537a8bcea425390",
"size": "1218",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MVC.SinglePage.Data/TrainingProduct.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "105"
},
{
"name": "C#",
"bytes": "28659"
},
{
"name": "CSS",
"bytes": "605"
},
{
"name": "JavaScript",
"bytes": "10918"
}
],
"symlink_target": ""
} |
export class TableView {
constructor(node, cellMinWidth) {
this.node = node;
this.cellMinWidth = cellMinWidth;
this.dom = document.createElement('div');
this.dom.className = 'tableWrapper';
this.table = this.dom.appendChild(document.createElement('table'));
this.colgroup = this.table.appendChild(document.createElement('colgroup'));
updateColumns(node, this.colgroup, this.table, cellMinWidth);
this.contentDOM = this.table.appendChild(document.createElement('tbody'));
}
update(node) {
if (node.type != this.node.type) return false;
this.node = node;
updateColumns(node, this.colgroup, this.table, this.cellMinWidth);
return true;
}
ignoreMutation(record) {
return (
record.type == 'attributes' &&
(record.target == this.table || this.colgroup.contains(record.target))
);
}
}
export function updateColumns(
node,
colgroup,
table,
cellMinWidth,
overrideCol,
overrideValue,
) {
let totalWidth = 0,
fixedWidth = true;
let nextDOM = colgroup.firstChild,
row = node.firstChild;
for (let i = 0, col = 0; i < row.childCount; i++) {
let { colspan, colwidth } = row.child(i).attrs;
for (let j = 0; j < colspan; j++, col++) {
let hasWidth =
overrideCol == col ? overrideValue : colwidth && colwidth[j];
let cssWidth = hasWidth ? hasWidth + 'px' : '';
totalWidth += hasWidth || cellMinWidth;
if (!hasWidth) fixedWidth = false;
if (!nextDOM) {
colgroup.appendChild(document.createElement('col')).style.width =
cssWidth;
} else {
if (nextDOM.style.width != cssWidth) nextDOM.style.width = cssWidth;
nextDOM = nextDOM.nextSibling;
}
}
}
while (nextDOM) {
let after = nextDOM.nextSibling;
nextDOM.parentNode.removeChild(nextDOM);
nextDOM = after;
}
if (fixedWidth) {
table.style.width = totalWidth + 'px';
table.style.minWidth = '';
} else {
table.style.width = '';
table.style.minWidth = totalWidth + 'px';
}
}
| {
"content_hash": "165e40a3c2d1ab3646c60e05e9b15c6b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 28.816901408450704,
"alnum_prop": 0.6358748778103617,
"repo_name": "ProseMirror/prosemirror-tables",
"id": "6969c9fe025615d83b7939245511b84dd274cb79",
"size": "2046",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/tableview.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "760"
},
{
"name": "HTML",
"bytes": "1450"
},
{
"name": "JavaScript",
"bytes": "131951"
},
{
"name": "TypeScript",
"bytes": "748"
}
],
"symlink_target": ""
} |
package java.awt.image;
/**
* * JDK Class Emulation for GWT
*/
public class ImageObserver {
}
| {
"content_hash": "e238d25cc0be9b58fc9ffbef8c5f713a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 32,
"avg_line_length": 11,
"alnum_prop": 0.6666666666666666,
"repo_name": "cheminfo/openchemlib-js",
"id": "d34fac5dea8729e845bea8caadab7bed2b999e94",
"size": "1620",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/com/actelion/research/gwt/jre/java/awt/image/ImageObserver.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "2923"
},
{
"name": "HTML",
"bytes": "4091"
},
{
"name": "Java",
"bytes": "7147879"
},
{
"name": "JavaScript",
"bytes": "53932"
},
{
"name": "Shell",
"bytes": "174"
}
],
"symlink_target": ""
} |
package cf.brforgers.mods.ArchitectFriend.blocks;
import cf.brforgers.mods.ArchitectFriend.ArchitectFriend;
import cf.brforgers.mods.ArchitectFriend.Lib;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import java.util.List;
public class TrueColorClay extends Block {
@SideOnly(Side.CLIENT)
protected IIcon[] icons = new IIcon[16];
public TrueColorClay() {
super(Material.rock);
this.setBlockName("TrueColorClay");
this.setBlockTextureName(Lib.TEXTURE_PATH + "Clay");
this.setCreativeTab(ArchitectFriend.tabArchitect);
this.setHardness(2.0F);
this.setResistance(6.0F);
this.setStepSound(soundTypeStone);
}
/* Metadata Override */
@Override
public int damageDropped(int meta) {
return meta;
}
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
for (int i = 0; i < 16; i++) {
list.add(new ItemStack(item, 1, i));
}
}
/* Texture Override */
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return this.icons[meta];
}
@Override
public void registerBlockIcons(IIconRegister reg) {
for (int i = 0; i < 16; i++) {
this.icons[i] = reg.registerIcon(this.textureName + "_" + i);
}
}
}
| {
"content_hash": "90533bc35a814eb9464dc4da0c752956",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 73,
"avg_line_length": 28.4,
"alnum_prop": 0.676056338028169,
"repo_name": "TheBrazillianForgersTeam/ArchitectFriend",
"id": "5a1a4dc86b7dfddb23135879fbe1711d9811f337",
"size": "1704",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/cf/brforgers/mods/ArchitectFriend/blocks/TrueColorClay.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "19883"
}
],
"symlink_target": ""
} |
<?php
function bailout($message)
{
exit($message."\n");
}
function check_dir($source)
{
if (!file_exists($source)) {
bailout('The directory '.$source.' does not exist');
}
if (!is_dir($source)) {
bailout('The file '.$source.' is not a directory');
}
}
function check_command($command)
{
exec('which '.$command, $output, $result);
if ($result !== 0) {
bailout('The command "'.$command.'" is not installed');
}
}
function clear_directory($directory)
{
$iterator = new \DirectoryIterator($directory);
foreach ($iterator as $file) {
if (!$file->isDot()) {
if ($file->isDir()) {
clear_directory($file->getPathname());
} else {
unlink($file->getPathname());
}
}
}
}
function make_directory($directory)
{
if (!file_exists($directory)) {
mkdir($directory);
}
if (!is_dir($directory)) {
bailout('The file '.$directory.' already exists but is no directory');
}
}
function list_files($directory, $extension)
{
$files = array();
$iterator = new \DirectoryIterator($directory);
foreach ($iterator as $file) {
if (!$file->isDot() && substr($file->getFilename(), -strlen($extension)) === $extension) {
$files[] = substr($file->getFilename(), 0, -strlen($extension));
}
}
return $files;
}
function genrb($source, $target, $icuBinPath = '', $params = '')
{
exec($icuBinPath.'genrb --quiet '.$params.' -d '.$target.' '.$source.DIRECTORY_SEPARATOR.'*.txt', $output, $result);
if ($result !== 0) {
bailout('genrb failed');
}
}
function genrb_file($target, $source, $locale, $icuBinPath = '')
{
exec($icuBinPath.'genrb --quiet -d '.$target.' '.$source.DIRECTORY_SEPARATOR.$locale.'.txt', $output, $result);
if ($result !== 0) {
bailout('genrb failed');
}
}
function load_resource_bundle($locale, $directory)
{
$bundle = \ResourceBundle::create($locale, $directory);
if (null === $bundle) {
bailout('The resource bundle for locale '.$locale.' could not be loaded from directory '.$directory);
}
return $bundle;
}
function get_data($index, $dataDir, $locale = 'en', $constraint = null)
{
$data = array();
$bundle = load_resource_bundle($locale, $dataDir);
foreach ($bundle->get($index) as $code => $name) {
if (null !== $constraint) {
if ($constraint($code)) {
$data[$code] = $name;
}
continue;
}
$data[$code] = $name;
}
$collator = new \Collator($locale);
$collator->asort($data);
return $data;
}
function icu_version() {
exec('icu-config --version', $output, $result);
if ($result !== 0 || !isset($output[0])) {
bailout('icu-config failed');
}
return $output[0];
}
function normalize_icu_version($version) {
preg_match('/^(?P<version>[0-9]\.[0-9]|[0-9]{2,})/', $version, $matches);
return $matches['version'];
}
function download_icu_data($version) {
$icu = parse_ini_file(__DIR__.'/icu.ini');
if (!isset($icu[$version])) {
bailout('The version '.$version.' is not available in the datasource.ini file.');
}
$checkoutPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'data-'.$version;
exec('svn checkout '.$icu[$version].' '.$checkoutPath, $output, $result);
if ($result !== 0) {
bailout('svn failed');
}
return $checkoutPath;
}
function is_icu_version_42_or_earlier($version)
{
return version_compare($version, '4.4', '<');
}
function create_stub_datafile($locale, $target, $data)
{
$template = <<<TEMPLATE
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return %s;
TEMPLATE;
ksort($data);
$data = var_export($data, true);
$data = preg_replace('/array \(/', 'array(', $data);
$data = preg_replace('/\n {1,10}array\(/', 'array(', $data);
$data = preg_replace('/ /', ' ', $data);
$data = sprintf($template, $data);
file_put_contents($target.DIRECTORY_SEPARATOR.$locale.'.php', $data);
}
function create_svn_info_file($source, $target)
{
exec('svn info --xml '.$source, $output, $result);
$xml = simplexml_load_string(implode("\n", $output));
if ($result !== 0) {
bailout('svn info failed');
}
$url = (string) $xml->entry->url;
$revision = (string) $xml->entry->commit['revision'];
$author = (string) $xml->entry->commit->author;
$date = (string) $xml->entry->commit->date;
$data = <<<SVN_INFO_DATA
SVN info data
=============
URL: $url
Revision: $revision
Author: $author
Date: $date
SVN_INFO_DATA;
file_put_contents($target.DIRECTORY_SEPARATOR.'svn-info.txt', $data);
}
if ($GLOBALS['argc'] < 1) {
bailout(<<<MESSAGE
Usage: php build-data.php [icu-version] [icu-binaries-path]
Builds or update the ICU data in Symfony2 for a specific ICU version. If the
ICU version or the path to the binaries are not provided, it will build the
latest version released using the genrb found in the environment path.
Examples:
php build-data.php 4.2
It will build the ICU data using the 49 version data
php build-data.php 4.2 /path/to/icu/bin
It will build the ICU data using the 49 version data and the genrb and
icu-config binaries found in the environment path
It is recommended to use the ICU binaries in the same version of the desired
version to build the data files.
Read the UPDATE.txt file for more info.
MESSAGE
);
}
check_command('svn');
check_command('icu-config');
// Script options
$version = isset($GLOBALS['argv'][1]) ? $GLOBALS['argv'][1] : icu_version();
$icuBinPath = isset($GLOBALS['argv'][2]) ? $GLOBALS['argv'][2] : '';
// Slash the path
if ('' != $icuBinPath && (strrpos($icuBinPath, DIRECTORY_SEPARATOR) + 1 != strlen($icuBinPath))) {
$icuBinPath .= DIRECTORY_SEPARATOR;
}
check_command($icuBinPath.'genrb');
$version = normalize_icu_version($version);
$source = download_icu_data($version);
// Verify that all required directories exist
check_dir($source);
check_dir($source.DIRECTORY_SEPARATOR.'.svn');
$source = realpath($source);
// Currency, language and region data are bundled in the locales directory in ICU <= 4.2
if (!is_icu_version_42_or_earlier($version)) {
check_dir($source.DIRECTORY_SEPARATOR.'curr');
check_dir($source.DIRECTORY_SEPARATOR.'lang');
check_dir($source.DIRECTORY_SEPARATOR.'region');
}
check_dir($source.DIRECTORY_SEPARATOR.'locales');
// Convert the *.txt resource bundles to *.res files
$target = $version;
$target = __DIR__.DIRECTORY_SEPARATOR.$target;
$currDir = $target.DIRECTORY_SEPARATOR.'curr';
$langDir = $target.DIRECTORY_SEPARATOR.'lang';
$localesDir = $target.DIRECTORY_SEPARATOR.'locales';
$namesDir = $target.DIRECTORY_SEPARATOR.'names';
$namesGeneratedDir = $namesDir.DIRECTORY_SEPARATOR.'generated';
$regionDir = $target.DIRECTORY_SEPARATOR.'region';
make_directory($target);
clear_directory($target);
create_svn_info_file($source, $target);
make_directory($currDir);
clear_directory($currDir);
// Currency data is available at the locales data files in ICU <= 4.2 and the supplementalData file is available at the
// misc directory
if (is_icu_version_42_or_earlier($version)) {
genrb_file($currDir, $source.DIRECTORY_SEPARATOR.'locales', 'en', $icuBinPath);
genrb_file($currDir, $source.DIRECTORY_SEPARATOR.'misc', 'supplementalData', $icuBinPath);
} else {
genrb_file($currDir, $source.DIRECTORY_SEPARATOR.'curr', 'en', $icuBinPath);
genrb_file($currDir, $source.DIRECTORY_SEPARATOR.'curr', 'supplementalData', $icuBinPath);
}
// It seems \ResourceBundle does not like locale names with uppercase chars then we rename the binary file
// See: http://bugs.php.net/bug.php?id=54025
$filename_from = $currDir.DIRECTORY_SEPARATOR.'supplementalData.res';
$filename_to = $currDir.DIRECTORY_SEPARATOR.'supplementaldata.res';
if (!rename($filename_from, $filename_to)) {
bailout('The file '.$filename_from.' could not be renamed');
}
make_directory($langDir);
clear_directory($langDir);
// Language data is available at the locales data files in ICU <= 4.2
if (is_icu_version_42_or_earlier($version)) {
genrb($source.DIRECTORY_SEPARATOR.'locales', $langDir, $icuBinPath);
} else {
genrb($source.DIRECTORY_SEPARATOR.'lang', $langDir, $icuBinPath);
}
make_directory($localesDir);
clear_directory($localesDir);
genrb($source.DIRECTORY_SEPARATOR.'locales', $localesDir, $icuBinPath);
make_directory($regionDir);
clear_directory($regionDir);
// Region data is available at the locales data files in ICU <= 4.2
if (is_icu_version_42_or_earlier($version)) {
genrb($source.DIRECTORY_SEPARATOR.'locales', $regionDir, $icuBinPath);
} else {
genrb($source.DIRECTORY_SEPARATOR.'region', $regionDir, $icuBinPath);
}
make_directory($namesDir);
clear_directory($namesDir);
make_directory($namesGeneratedDir);
clear_directory($namesGeneratedDir);
// Discover the list of supported locales, which are the names of the resource
// bundles in the "locales" directory
$supportedLocales = list_files($localesDir, '.res');
sort($supportedLocales);
// Delete unneeded locales
foreach ($supportedLocales as $key => $supportedLocale) {
// Delete all aliases from the list
// i.e., "az_AZ" is an alias for "az_Latn_AZ"
$localeBundleOrig = file_get_contents($source.DIRECTORY_SEPARATOR.'locales'.DIRECTORY_SEPARATOR.$supportedLocale.'.txt');
// The key "%%ALIAS" is not accessible through the \ResourceBundle class
if (strpos($localeBundleOrig, '%%ALIAS') !== false) {
unset($supportedLocales[$key]);
}
// Delete locales that have no content (i.e. only "Version" key)
$localeBundle = load_resource_bundle($supportedLocale, $localesDir);
// There seems to be no other way for identifying all keys in this specific
// resource bundle
$bundleKeys = array();
foreach ($localeBundle as $bundleKey => $_) {
$bundleKeys[] = $bundleKey;
}
if ($bundleKeys === array('Version')) {
unset($supportedLocales[$key]);
}
}
// Discover the list of locales for which individual language/region names
// exist. This list contains for example "de" and "de_CH", but not "de_DE" which
// is equal to "de"
$translatedLocales = array_unique(array_merge(
list_files($langDir, '.res'),
list_files($regionDir, '.res')
));
sort($translatedLocales);
// For each translated locale, generate a list of locale names
// Each locale name has the form: "Language (Script, Region, Variant1, ...)
// Script, Region and Variants are optional. If none of them is available,
// the braces are not printed.
foreach ($translatedLocales as $translatedLocale) {
// Don't include ICU's root resource bundle
if ($translatedLocale === 'root') {
continue;
}
$langBundle = load_resource_bundle($translatedLocale, $langDir);
$regionBundle = load_resource_bundle($translatedLocale, $regionDir);
$localeNames = array();
foreach ($supportedLocales as $supportedLocale) {
// Don't include ICU's root resource bundle
if ($supportedLocale === 'root') {
continue;
}
$lang = \Locale::getPrimaryLanguage($supportedLocale);
$script = \Locale::getScript($supportedLocale);
$region = \Locale::getRegion($supportedLocale);
$variants = \Locale::getAllVariants($supportedLocale);
// Currently the only available variant is POSIX, which we don't want
// to include in the list
if (count($variants) > 0) {
continue;
}
$langName = $langBundle->get('Languages')->get($lang);
$extras = array();
// Some languages are simply not translated
// Example: "az" (Azerbaijani) has no translation in "af" (Afrikaans)
if (!$langName) {
continue;
}
// "af" (Afrikaans) has no "Scripts" block
if (!$langBundle->get('Scripts')) {
continue;
}
// "as" (Assamese) has no "Variants" block
if (!$langBundle->get('Variants')) {
continue;
}
// Discover the name of the script part of the locale
// i.e. in zh_Hans_MO, "Hans" is the script
if ($script) {
// Some languages are translated together with their script,
// i.e. "zh_Hans" is translated as "Simplified Chinese"
if ($langBundle->get('Languages')->get($lang.'_'.$script)) {
$langName = $langBundle->get('Languages')->get($lang.'_'.$script);
// If the script is appended in braces, extract it
// i.e. "zh_Hans" is translated as "Chinesisch (vereinfacht)"
// in "de"
if (strpos($langName, '(') !== false) {
list($langName, $scriptName) = preg_split('/[\s()]/', $langName, null, PREG_SPLIT_NO_EMPTY);
$extras[] = $scriptName;
}
} else {
$scriptName = $langBundle->get('Scripts')->get($script);
// Some scripts are not translated into every language
if (!$scriptName) {
continue;
}
$extras[] = $scriptName;
}
}
// Discover the name of the region part of the locale
// i.e. in de_AT, "AT" is the region
if ($region) {
// Some languages are translated together with their region,
// i.e. "en_GB" is translated as "British English"
// we don't include these languages though because they mess up
// the locale sorting
// if ($langBundle->get('Languages')->get($lang.'_'.$region)) {
// $langName = $langBundle->get('Languages')->get($lang.'_'.$region);
// } else {
$regionName = $regionBundle->get('Countries')->get($region);
// Some regions are not translated into every language
if (!$regionName) {
continue;
}
$extras[] = $regionName;
// }
}
if (count($extras) > 0) {
$langName .= ' ('.implode(', ', $extras).')';
}
$localeNames[$supportedLocale] = $langName;
}
// If no names could be generated for the current locale, skip it
if (count($localeNames) === 0) {
continue;
}
$file = fopen($namesGeneratedDir.DIRECTORY_SEPARATOR.$translatedLocale.'.txt', 'w');
fwrite($file, "$translatedLocale{\n");
fwrite($file, " Locales{\n");
foreach ($localeNames as $supportedLocale => $langName) {
fwrite($file, " $supportedLocale{\"$langName\"}\n");
}
fwrite($file, " }\n");
fwrite($file, "}\n");
fclose($file);
}
// Convert generated files to binary format
// Even if the source and generated file are UTF-8 encoded, for some reason the data seems not correctly encoded, leading to
// a parse error in genrb (Stopped parsing resource with U_ILLEGAL_CHAR_FOUND). So we call the genrb passing that the source
// files are UTF-8 encoded.
if (is_icu_version_42_or_earlier($version)) {
genrb($namesGeneratedDir, $namesDir, $icuBinPath, '-e UTF-8');
} else {
genrb($namesGeneratedDir, $namesDir, $icuBinPath);
}
// Clean up
clear_directory($namesGeneratedDir);
rmdir($namesGeneratedDir);
// Generate the data to the stubbed intl classes We only extract data for the 'en' locale
// The extracted data is used only by the stub classes
$defaultLocale = 'en';
$currencies = array();
$currenciesMeta = array();
$defaultMeta = array();
$bundle = load_resource_bundle('supplementaldata', $currDir);
foreach ($bundle->get('CurrencyMeta') as $code => $data) {
// The 'DEFAULT' key contains the fraction digits and the rounding increment that are common for a lot of currencies
// Only currencies with different values are added to the icu-data (e.g: CHF and JPY)
if ('DEFAULT' == $code) {
$defaultMeta = array(
'fractionDigits' => $data[0],
'roundingIncrement' => $data[1],
);
continue;
}
$currenciesMeta[$code]['fractionDigits'] = $data[0];
$currenciesMeta[$code]['roundingIncrement'] = $data[1];
}
$bundle = load_resource_bundle('en', $currDir);
foreach ($bundle->get('Currencies') as $code => $data) {
$currencies[$code]['symbol'] = $data[0];
$currencies[$code]['name'] = $data[1];
if (!isset($currenciesMeta[$code])) {
$currencies[$code]['fractionDigits'] = $defaultMeta['fractionDigits'];
$currencies[$code]['roundingIncrement'] = $defaultMeta['roundingIncrement'];
continue;
}
$currencies[$code]['fractionDigits'] = $currenciesMeta[$code]['fractionDigits'];
$currencies[$code]['roundingIncrement'] = $currenciesMeta[$code]['roundingIncrement'];
}
// Countries.
$countriesConstraint = function($code) {
// Global countries (f.i. "America") have numeric codes
// Countries have alphabetic codes
// "ZZ" is the code for unknown country
if (ctype_alpha($code) && 'ZZ' !== $code) {
return true;
}
return false;
};
$countries = get_data('Countries', $regionDir, $defaultLocale, $countriesConstraint);
// Languages
$languagesConstraint = function($code) {
// "mul" is the code for multiple languages
if ('mul' !== $code) {
return true;
}
return false;
};
$languages = get_data('Languages', $langDir, $defaultLocale, $languagesConstraint);
// Display locales
$displayLocales = get_data('Locales', $namesDir, $defaultLocale);
// Create the stubs datafiles
$stubDir = $target.DIRECTORY_SEPARATOR.'stub';
$stubCurrDir = $stubDir.DIRECTORY_SEPARATOR.'curr';
$stubLangDir = $stubDir.DIRECTORY_SEPARATOR.'lang';
$stubNamesDir = $stubDir.DIRECTORY_SEPARATOR.'names';
$stubRegionDir = $stubDir.DIRECTORY_SEPARATOR.'region';
// Create the directories
make_directory($stubDir);
make_directory($stubCurrDir);
make_directory($stubLangDir);
make_directory($stubNamesDir);
make_directory($stubRegionDir);
clear_directory($stubCurrDir);
clear_directory($stubLangDir);
clear_directory($stubNamesDir);
clear_directory($stubRegionDir);
create_stub_datafile($defaultLocale, $stubCurrDir, $currencies);
create_stub_datafile($defaultLocale, $stubLangDir, $languages);
create_stub_datafile($defaultLocale, $stubNamesDir, $displayLocales);
create_stub_datafile($defaultLocale, $stubRegionDir, $countries);
// Clean up
clear_directory($currDir);
rmdir($currDir); | {
"content_hash": "0b4bc831fce5e8f71af6596aa3dd150d",
"timestamp": "",
"source": "github",
"line_count": 621,
"max_line_length": 125,
"avg_line_length": 31.202898550724637,
"alnum_prop": 0.6110853073231151,
"repo_name": "lrt/lrt",
"id": "0fa7fe49f4a8e167e0277084c7e1ea68323a827e",
"size": "19613",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/build-data.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "143710"
},
{
"name": "PHP",
"bytes": "256054"
},
{
"name": "Perl",
"bytes": "1091"
},
{
"name": "Shell",
"bytes": "2275"
}
],
"symlink_target": ""
} |
'use strict';
exports.__esModule = true;
var _utilities = require('../utilities');
var data = {
settings: {
'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/
},
messages: {
'isRequired': 'er påkrevd',
'onValidateCallback': 'ikke gyldig verdi',
'AlphaNumericOrWhitespaceValidationRule': function AlphaNumericOrWhitespaceValidationRule(newValue, threshold) {
return 'kan kun inneholde alfanumeriske tegn eller mellomrom';
},
'AlphaNumericValidationRule': function AlphaNumericValidationRule(newValue, threshold) {
return 'kan kun inneholde alfanumeriske tegn';
},
'AlphaValidationRule': function AlphaValidationRule(newValue, threshold) {
return 'kan kun inneholde bokstaver';
},
'AlphaOrWhitespaceValidationRule': function AlphaOrWhitespaceValidationRule(newValue, threshold) {
return 'kan kun inneholde bokstaver og mellomrom';
},
'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) {
return 'skal være mellom ' + _utilities.Utilities.getValue(threshold.minimumLength) + ' og ' + _utilities.Utilities.getValue(threshold.maximumLength) + ' tegn langt';
},
'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) {
return 'skal være mellom ' + _utilities.Utilities.getValue(threshold.minimumValue) + ' og ' + _utilities.Utilities.getValue(threshold.maximumValue);
},
'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) {
return 'ikke en gyldig verdi';
},
'DigitValidationRule': function DigitValidationRule(newValue, threshold) {
return 'kan kun inneholde tall';
},
'EmailValidationRule': function EmailValidationRule(newValue, threshold) {
return 'ikke en gyldig e-postadresse';
},
'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) {
return 'burde være ' + _utilities.Utilities.getValue(threshold.otherValue);
},
'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) {
return 'kan ikke være ' + _utilities.Utilities.getValue(threshold.otherValue);
},
'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) {
return 'er ikke like ' + _utilities.Utilities.getValue(threshold.otherValueLabel);
},
'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) {
return 'kan ikke være like ' + _utilities.Utilities.getValue(threshold.otherValueLabel);
},
'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) {
return 'ikke en gyldig verdi';
},
'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) {
return 'skal være ' + _utilities.Utilities.getValue(threshold) + ' eller høyere';
},
'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) {
return 'skal være minst ' + _utilities.Utilities.getValue(threshold) + ' tegn langt';
},
'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) {
return 'skal være større enn ' + _utilities.Utilities.getValue(threshold);
},
'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) {
return 'skal være ' + _utilities.Utilities.getValue(threshold) + ' eller mindre';
},
'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) {
return 'kan ikke være lengre enn ' + _utilities.Utilities.getValue(threshold) + ' tegn';
},
'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) {
return 'skal være mindre enn ' + _utilities.Utilities.getValue(threshold);
},
'NumericValidationRule': function NumericValidationRule(newValue, threshold) {
return 'skal være en tallverdi';
},
'NoSpacesValidationRule': function NoSpacesValidationRule(newValue, threshold) {
return 'kan ikke inneholde mellomrom';
},
'RegexValidationRule': function RegexValidationRule(newValue, threshold) {
return 'ikke en gyldig verdi';
},
'ContainsOnlyValidationRule': function ContainsOnlyValidationRule(newValue, threshold) {
return 'ikke en gyldig verdi';
},
'StrongPasswordValidationRule': function StrongPasswordValidationRule(newValue, threshold) {
return 'skal være en kombinasjon av små bokstaver, store bokstaver, tall og spesialtegn';
},
'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) {
return 'skal inneholde minst ' + _utilities.Utilities.getValue(threshold) + ' av følgende grupper: små bokstaver, store bokstaver, tall og spesialtegn';
},
'URLValidationRule': function URLValidationRule(newValue, threshold) {
return 'ikke en gyldig URL';
}
}
};
exports.data = data; | {
"content_hash": "121e1da3e8285c5274692f6faef072f8",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 172,
"avg_line_length": 52.18556701030928,
"alnum_prop": 0.7337020940339787,
"repo_name": "vulvulune/validation",
"id": "9d5bba3460c34ac4b91cde0bd97c8ab565e7f046",
"size": "5081",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "dist/commonjs/resources/nb-NO.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1337"
},
{
"name": "JavaScript",
"bytes": "957110"
}
],
"symlink_target": ""
} |
package org.apache.carbondata.core.datastore;
import java.io.IOException;
import org.apache.carbondata.core.cache.update.BlockletLevelDeleteDeltaDataCache;
import org.apache.carbondata.core.datastore.chunk.impl.DimensionRawColumnChunk;
import org.apache.carbondata.core.datastore.chunk.impl.MeasureRawColumnChunk;
/**
* Interface data block reference
*/
public interface DataRefNode {
/**
* Method to get the next block this can be used while scanning when
* iterator of this class can be used iterate over blocks
*
* @return next block
*/
DataRefNode getNextDataRefNode();
/**
* to get the number of keys tuples present in the block
*
* @return number of keys in the block
*/
int nodeSize();
/**
* Method can be used to get the block index .This can be used when multiple
* thread can be used scan group of blocks in that can we can assign the
* some of the blocks to one thread and some to other
*
* @return block number
*/
long nodeNumber();
/**
* This method will be used to get the max value of all the columns this can
* be used in case of filter query
*
*/
byte[][] getColumnsMaxValue();
/**
* This method will be used to get the min value of all the columns this can
* be used in case of filter query
*
*/
byte[][] getColumnsMinValue();
/**
* Below method will be used to get the dimension chunks
*
* @param fileReader file reader to read the chunks from file
* @param blockIndexes range indexes of the blocks need to be read
* value can be {{0,10},{11,12},{13,13}}
* here 0 to 10 and 11 to 12 column blocks will be read in one
* IO operation 13th column block will be read separately
* This will be helpful to reduce IO by reading bigger chunk of
* data in On IO
* @return dimension data chunks
*/
DimensionRawColumnChunk[] getDimensionChunks(FileHolder fileReader, int[][] blockIndexes)
throws IOException;
/**
* Below method will be used to get the dimension chunk
*
* @param fileReader file reader to read the chunk from file
* @return dimension data chunk
*/
DimensionRawColumnChunk getDimensionChunk(FileHolder fileReader, int blockIndexes)
throws IOException;
/**
* Below method will be used to get the measure chunk
*
* @param fileReader file reader to read the chunk from file
* @param blockIndexes range indexes of the blocks need to be read
* value can be {{0,10},{11,12},{13,13}}
* here 0 to 10 and 11 to 12 column blocks will be read in one
* IO operation 13th column block will be read separately
* This will be helpful to reduce IO by reading bigger chunk of
* data in On IO
* @return measure column data chunk
*/
MeasureRawColumnChunk[] getMeasureChunks(FileHolder fileReader, int[][] blockIndexes)
throws IOException;
/**
* Below method will be used to read the measure chunk
*
* @param fileReader file read to read the file chunk
* @param blockIndex block index to be read from file
* @return measure data chunk
*/
MeasureRawColumnChunk getMeasureChunk(FileHolder fileReader, int blockIndex) throws IOException;
/**
* @param deleteDeltaDataCache
*/
void setDeleteDeltaDataCache(BlockletLevelDeleteDeltaDataCache deleteDeltaDataCache);
/**
* @return
*/
BlockletLevelDeleteDeltaDataCache getDeleteDeltaDataCache();
/**
* number of pages in blocklet
* @return
*/
int numberOfPages();
String getNodeId();
DimensionRawColumnChunk[] getDimensionChunksForSort(FileHolder fileReader, int[] sortDimensionBlockIndexes, int limit, boolean descSortFlg);
DimensionRawColumnChunk getDimensionChunk(FileHolder fileReader, int blockIndexes, int limit);
DimensionRawColumnChunk getDimensionChunk(FileHolder fileReader, int blockIndexes, int limit, int maxLogicalRowId, boolean descSortFlg);
}
| {
"content_hash": "8a3af4666aef92695d92bce7796c830b",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 142,
"avg_line_length": 33.80165289256198,
"alnum_prop": 0.6831295843520783,
"repo_name": "mayunSaicmotor/incubator-carbondata",
"id": "5286f272690d57086af3676e775bd78cd71e2a27",
"size": "4890",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/main/java/org/apache/carbondata/core/datastore/DataRefNode.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "4703198"
},
{
"name": "Python",
"bytes": "19945"
},
{
"name": "Scala",
"bytes": "1849351"
},
{
"name": "Shell",
"bytes": "6887"
},
{
"name": "Smalltalk",
"bytes": "86"
},
{
"name": "Thrift",
"bytes": "20066"
}
],
"symlink_target": ""
} |
import datetime
import json
import re
from six.moves import urllib
import httmock
import requests
import six
from girder.constants import SettingKey
from tests import base
def setUpModule():
base.enabledPlugins.append('oauth')
base.startServer()
def tearDownModule():
base.stopServer()
class OauthTest(base.TestCase):
def setUp(self):
base.TestCase.setUp(self)
# girder.plugins is not available until setUp is running
global PluginSettings
from girder.plugins.oauth.constants import PluginSettings
self.adminUser = self.model('user').createUser(
email='rocky@phila.pa.us',
login='rocky',
firstName='Robert',
lastName='Balboa',
password='adrian',
admin=True
)
# Specifies which test account (typically "new" or "existing") a
# redirect to a provider will simulate authentication for
self.accountType = None
def testDeriveLogin(self):
"""
Unit tests the _deriveLogin method of the provider classes.
"""
from girder.plugins.oauth.providers.base import ProviderBase
login = ProviderBase._deriveLogin('1234@mail.com', 'John', 'Doe')
self.assertEqual(login, 'johndoe')
login = ProviderBase._deriveLogin('hello.world.foo@mail.com', 'A', 'B')
self.assertEqual(login, 'helloworldfoo')
login = ProviderBase._deriveLogin('hello.world@mail.com', 'A', 'B',
'user2')
self.assertEqual(login, 'user2')
# This should conflict with the saved admin user
login = ProviderBase._deriveLogin('rocky@phila.pa.us', 'Robert',
'Balboa', 'rocky')
self.assertEqual(login, 'rocky1')
def _testOauth(self, providerInfo):
# Close registration to start off, and simulate a new user
self.model('setting').set(SettingKey.REGISTRATION_POLICY, 'closed')
self.accountType = 'new'
# We should get an empty listing when no providers are set up
params = {
'key': PluginSettings.PROVIDERS_ENABLED,
'value': []
}
resp = self.request(
'/system/setting', user=self.adminUser, method='PUT', params=params)
self.assertStatusOk(resp)
resp = self.request('/oauth/provider', exception=True, params={
'redirect': 'http://localhost/#foo/bar',
'list': True
})
self.assertStatusOk(resp)
self.assertFalse(resp.json)
# Turn on provider, but don't set other settings
params = {
'list': json.dumps([{
'key': PluginSettings.PROVIDERS_ENABLED,
'value': [providerInfo['id']]
}])
}
resp = self.request(
'/system/setting', user=self.adminUser, method='PUT', params=params)
self.assertStatusOk(resp)
resp = self.request('/oauth/provider', exception=True, params={
'redirect': 'http://localhost/#foo/bar'})
self.assertStatus(resp, 500)
# Set up provider normally
params = {
'list': json.dumps([
{
'key': PluginSettings.PROVIDERS_ENABLED,
'value': [providerInfo['id']]
}, {
'key': providerInfo['client_id']['key'],
'value': providerInfo['client_id']['value']
}, {
'key': providerInfo['client_secret']['key'],
'value': providerInfo['client_secret']['value']
}
])
}
resp = self.request(
'/system/setting', user=self.adminUser, method='PUT',
params=params)
self.assertStatusOk(resp)
# No need to re-fetch and test all of these settings values; they will
# be implicitly tested later
# Make sure that if no list param is passed, we receive the old format
resp = self.request('/oauth/provider', params={
'redirect': 'http://localhost/#foo/bar'
})
self.assertStatusOk(resp)
self.assertIsInstance(resp.json, dict)
self.assertEqual(len(resp.json), 1)
self.assertIn(providerInfo['name'], resp.json)
self.assertRegexpMatches(
resp.json[providerInfo['name']],
providerInfo['url_re'])
# This will need to be called several times, to get fresh tokens
def getProviderResp():
resp = self.request('/oauth/provider', params={
'redirect': 'http://localhost/#foo/bar',
'list': True
})
self.assertStatusOk(resp)
self.assertIsInstance(resp.json, list)
self.assertEqual(len(resp.json), 1)
providerResp = resp.json[0]
self.assertSetEqual(
set(six.viewkeys(providerResp)),
{'id', 'name', 'url'})
self.assertEqual(providerResp['id'], providerInfo['id'])
self.assertEqual(providerResp['name'], providerInfo['name'])
self.assertRegexpMatches(
providerResp['url'],
providerInfo['url_re'])
redirectParams = urllib.parse.parse_qs(
urllib.parse.urlparse(providerResp['url']).query)
csrfTokenParts = redirectParams['state'][0].partition('.')
token = self.model('token').load(
csrfTokenParts[0], force=True, objectId=False)
self.assertLess(
token['expires'],
datetime.datetime.utcnow() + datetime.timedelta(days=0.30))
self.assertEqual(
csrfTokenParts[2],
'http://localhost/#foo/bar')
return providerResp
# Try the new format listing
getProviderResp()
# Try callback, for a non-existant provider
resp = self.request('/oauth/foobar/callback')
self.assertStatus(resp, 400)
# Try callback, without providing any params
resp = self.request('/oauth/%s/callback' % providerInfo['id'])
self.assertStatus(resp, 400)
# Try callback, providing params as though the provider failed
resp = self.request(
'/oauth/%s/callback' % providerInfo['id'],
params={
'code': None,
'error': 'some_custom_error',
}, exception=True)
self.assertStatus(resp, 502)
self.assertEqual(
resp.json['message'],
"Provider returned error: 'some_custom_error'.")
# This will need to be called several times, to use fresh tokens
def getCallbackParams(providerResp):
resp = requests.get(providerResp['url'], allow_redirects=False)
self.assertEqual(resp.status_code, 302)
callbackLoc = urllib.parse.urlparse(resp.headers['location'])
self.assertEqual(
callbackLoc.path,
r'/api/v1/oauth/%s/callback' % providerInfo['id'])
callbackLocQuery = urllib.parse.parse_qs(callbackLoc.query)
self.assertNotHasKeys(callbackLocQuery, ('error',))
callbackParams = {
key: val[0] for key, val in six.viewitems(callbackLocQuery)
}
return callbackParams
# Call (simulated) external provider
getCallbackParams(getProviderResp())
# Try callback, with incorrect CSRF token
params = getCallbackParams(getProviderResp())
params['state'] = 'something_wrong'
resp = self.request('/oauth/%s/callback' % providerInfo['id'],
params=params)
self.assertStatus(resp, 403)
self.assertTrue(
resp.json['message'].startswith('Invalid CSRF token'))
# Try callback, with expired CSRF token
params = getCallbackParams(getProviderResp())
token = self.model('token').load(
params['state'].partition('.')[0], force=True, objectId=False)
token['expires'] -= datetime.timedelta(days=1)
self.model('token').save(token)
resp = self.request('/oauth/%s/callback' % providerInfo['id'],
params=params)
self.assertStatus(resp, 403)
self.assertTrue(
resp.json['message'].startswith('Expired CSRF token'))
# Try callback, with a valid CSRF token but no redirect
params = getCallbackParams(getProviderResp())
params['state'] = params['state'].partition('.')[0]
resp = self.request('/oauth/%s/callback' % providerInfo['id'],
params=params)
self.assertStatus(resp, 400)
self.assertTrue(
resp.json['message'].startswith('No redirect location'))
# Try callback, with incorrect code
params = getCallbackParams(getProviderResp())
params['code'] = 'something_wrong'
resp = self.request('/oauth/%s/callback' % providerInfo['id'],
params=params)
self.assertStatus(resp, 502)
# Try callback, with real parameters from provider, but still for the
# 'new' account
params = getCallbackParams(getProviderResp())
resp = self.request('/oauth/%s/callback' % providerInfo['id'],
params=params)
self.assertStatus(resp, 400)
self.assertTrue(
resp.json['message'].startswith(
'Registration on this instance is closed.'))
# This will need to be called several times, and will do a normal login
def doOauthLogin(accountType):
self.accountType = accountType
params = getCallbackParams(getProviderResp())
resp = self.request('/oauth/%s/callback' % providerInfo['id'],
params=params, isJson=False)
self.assertStatus(resp, 303)
self.assertEqual(resp.headers['Location'],
'http://localhost/#foo/bar')
self.assertTrue('girderToken' in resp.cookie)
resp = self.request('/user/me',
token=resp.cookie['girderToken'].value)
self.assertStatusOk(resp)
self.assertEqual(
resp.json['email'],
providerInfo['accounts'][accountType]['user']['email'])
self.assertEqual(
resp.json['login'],
providerInfo['accounts'][accountType]['user']['login'])
self.assertEqual(
resp.json['firstName'],
providerInfo['accounts'][accountType]['user']['firstName'])
self.assertEqual(
resp.json['lastName'],
providerInfo['accounts'][accountType]['user']['lastName'])
# Try callback for the 'existing' account, which should succeed
doOauthLogin('existing')
# Try callback for the 'new' account, with open registration
self.model('setting').set(SettingKey.REGISTRATION_POLICY, 'open')
doOauthLogin('new')
# Password login for 'new' OAuth-only user should fail gracefully
newUser = providerInfo['accounts']['new']['user']
resp = self.request('/user/authentication',
basicAuth='%s:mypasswd' % newUser['login'])
self.assertStatus(resp, 400)
self.assertTrue(
resp.json['message'].startswith('You don\'t have a password.'))
# Reset password for 'new' OAuth-only user should work
self.assertTrue(base.mockSmtp.isMailQueueEmpty())
resp = self.request(
'/user/password/temporary', method='PUT', params={
'email': providerInfo['accounts']['new']['user']['email']})
self.assertStatusOk(resp)
self.assertEqual(resp.json['message'], 'Sent temporary access email.')
self.assertTrue(base.mockSmtp.waitForMail())
msg = base.mockSmtp.getMail(parse=True)
# Pull out the auto-generated token from the email
body = msg.get_payload(decode=True).decode('utf8')
search = re.search('<a href="(.*)">', body)
link = search.group(1)
linkParts = link.split('/')
userId = linkParts[-3]
tokenId = linkParts[-1]
tempToken = self.model('token').load(
tokenId, force=True, objectId=False)
resp = self.request('/user/password/temporary/' + userId,
method='GET', params={'token': tokenId})
self.assertStatusOk(resp)
self.assertEqual(resp.json['user']['login'], newUser['login'])
# We should now be able to change the password
resp = self.request('/user/password',
method='PUT', user=resp.json['user'], params={
'old': tokenId,
'new': 'mypasswd'})
self.assertStatusOk(resp)
# The temp token should get deleted on password change
token = self.model('token').load(tempToken, force=True, objectId=False)
self.assertEqual(token, None)
# Password login for 'new' OAuth-only user should now succeed
resp = self.request('/user/authentication',
basicAuth='%s:mypasswd' % newUser['login'])
self.assertStatusOk(resp)
@httmock.all_requests
def mockOtherRequest(self, url, request):
raise Exception('Unexpected url %s' % str(request.url))
def testGoogleOauth(self): # noqa
providerInfo = {
'id': 'google',
'name': 'Google',
'client_id': {
'key': PluginSettings.GOOGLE_CLIENT_ID,
'value': 'google_test_client_id'
},
'client_secret': {
'key': PluginSettings.GOOGLE_CLIENT_SECRET,
'value': 'google_test_client_secret'
},
'allowed_callback_re':
r'^http://127\.0\.0\.1(?::\d+)?/api/v1/oauth/google/callback$',
'url_re': r'^https://accounts\.google\.com/o/oauth2/auth',
'accounts': {
'existing': {
'auth_code': 'google_existing_auth_code',
'access_token': 'google_existing_test_token',
'user': {
'login': self.adminUser['login'],
'email': self.adminUser['email'],
'firstName': self.adminUser['firstName'],
'lastName': self.adminUser['lastName'],
'oauth': {
'provider': 'google',
'id': '5326'
}
}
},
'new': {
'auth_code': 'google_new_auth_code',
'access_token': 'google_new_test_token',
'user': {
# this login is not provided by Google, but will be
# created internally by _deriveLogin
'login': 'creed',
'email': 'creed@la.ca.us',
'firstName': 'Apollo',
'lastName': 'Creed',
'oauth': {
'provider': 'google',
'id': 'the1best'
}
}
}
}
}
@httmock.urlmatch(scheme='https', netloc='^accounts.google.com$',
path='^/o/oauth2/auth$', method='GET')
def mockGoogleRedirect(url, request):
try:
params = urllib.parse.parse_qs(url.query)
self.assertEqual(
params['response_type'],
['code'])
self.assertEqual(
params['access_type'],
['online'])
self.assertEqual(
params['scope'],
['profile email'])
except (KeyError, AssertionError) as e:
return {
'status_code': 400,
'content': json.dumps({
'error': repr(e)
})
}
try:
self.assertEqual(
params['client_id'],
[providerInfo['client_id']['value']])
except (KeyError, AssertionError) as e:
return {
'status_code': 401,
'content': json.dumps({
'error': repr(e)
})
}
try:
self.assertRegexpMatches(
params['redirect_uri'][0],
providerInfo['allowed_callback_re'])
state = params['state'][0]
# Nothing to test for state, since provider doesn't care
except (KeyError, AssertionError) as e:
return {
'status_code': 400,
'content': json.dumps({
'error': repr(e)
})
}
returnQuery = urllib.parse.urlencode({
'state': state,
'code': providerInfo['accounts'][self.accountType]['auth_code']
})
return {
'status_code': 302,
'headers': {
'Location': '%s?%s' % (params['redirect_uri'][0],
returnQuery)
}
}
@httmock.urlmatch(scheme='https', netloc='^accounts.google.com$',
path='^/o/oauth2/token$', method='POST')
def mockGoogleToken(url, request):
try:
params = urllib.parse.parse_qs(request.body)
self.assertEqual(
params['client_id'],
[providerInfo['client_id']['value']])
except (KeyError, AssertionError) as e:
return {
'status_code': 401,
'content': json.dumps({
'error': repr(e)
})
}
try:
self.assertEqual(
params['grant_type'],
['authorization_code'])
self.assertEqual(
params['client_secret'],
[providerInfo['client_secret']['value']])
self.assertRegexpMatches(
params['redirect_uri'][0],
providerInfo['allowed_callback_re'])
for account in six.viewvalues(providerInfo['accounts']):
if account['auth_code'] == params['code'][0]:
break
else:
self.fail()
except (KeyError, AssertionError) as e:
return {
'status_code': 400,
'content': json.dumps({
'error': repr(e)
})
}
return json.dumps({
'token_type': 'Bearer',
'access_token': account['access_token'],
'expires_in': 3546,
'id_token': 'google_id_token'
})
@httmock.urlmatch(scheme='https', netloc='^www.googleapis.com$',
path='^/plus/v1/people/me$', method='GET')
def mockGoogleApi(url, request):
try:
for account in six.viewvalues(providerInfo['accounts']):
if 'Bearer %s' % account['access_token'] == \
request.headers['Authorization']:
break
else:
self.fail()
params = urllib.parse.parse_qs(url.query)
self.assertSetEqual(
set(params['fields'][0].split(',')),
{'id', 'emails', 'name'})
except AssertionError as e:
return {
'status_code': 401,
'content': json.dumps({
'error': repr(e)
})
}
return json.dumps({
'id': account['user']['oauth']['id'],
'name': {
'givenName': account['user']['firstName'],
'familyName': account['user']['lastName']
},
'emails': [
{
'type': 'other',
'value': 'styx@hades.gov'
}, {
'type': 'account',
'value': account['user']['email']
}
]
})
with httmock.HTTMock(
mockGoogleRedirect,
mockGoogleToken,
mockGoogleApi,
# Must keep "mockOtherRequest" last
self.mockOtherRequest
):
self._testOauth(providerInfo)
def testGithubOauth(self): # noqa
providerInfo = {
'id': 'github',
'name': 'GitHub',
'client_id': {
'key': PluginSettings.GITHUB_CLIENT_ID,
'value': 'github_test_client_id'
},
'client_secret': {
'key': PluginSettings.GITHUB_CLIENT_SECRET,
'value': 'github_test_client_secret'
},
'allowed_callback_re':
r'^http://127\.0\.0\.1(?::\d+)?/api/v1/oauth/github/callback$',
'url_re': r'^https://github\.com/login/oauth/authorize',
'accounts': {
'existing': {
'auth_code': 'github_existing_auth_code',
'access_token': 'github_existing_test_token',
'user': {
'login': self.adminUser['login'],
'email': self.adminUser['email'],
'firstName': self.adminUser['firstName'],
'lastName': self.adminUser['lastName'],
'oauth': {
'provider': 'github',
'id': '2399'
}
}
},
'new': {
'auth_code': 'github_new_auth_code',
'access_token': 'github_new_test_token',
'user': {
# login may be provided externally by GitHub; for
# simplicity here, do not use a username with whitespace
# or underscores
'login': 'drago',
'email': 'metaphor@labs.ussr.gov',
'firstName': 'Ivan',
'lastName': 'Drago',
'oauth': {
'provider': 'github',
'id': 1985
}
}
}
}
}
@httmock.urlmatch(scheme='https', netloc='^github.com$',
path='^/login/oauth/authorize$', method='GET')
def mockGithubRedirect(url, request):
redirectUri = None
try:
params = urllib.parse.parse_qs(url.query)
# Check redirect_uri first, so other errors can still redirect
redirectUri = params['redirect_uri'][0]
self.assertEqual(
params['client_id'],
[providerInfo['client_id']['value']])
except (KeyError, AssertionError) as e:
return {
'status_code': 404,
'content': json.dumps({
'error': repr(e)
})
}
try:
self.assertRegexpMatches(
redirectUri,
providerInfo['allowed_callback_re'])
state = params['state'][0]
# Nothing to test for state, since provider doesn't care
self.assertEqual(
params['scope'],
['user:email'])
except (KeyError, AssertionError) as e:
returnQuery = urllib.parse.urlencode({
'error': repr(e),
})
else:
returnQuery = urllib.parse.urlencode({
'state': state,
'code':
providerInfo['accounts'][self.accountType]['auth_code']
})
return {
'status_code': 302,
'headers': {
'Location': '%s?%s' % (redirectUri, returnQuery)
}
}
@httmock.urlmatch(scheme='https', netloc='^github.com$',
path='^/login/oauth/access_token$', method='POST')
def mockGithubToken(url, request):
try:
self.assertEqual(request.headers['Accept'], 'application/json')
params = urllib.parse.parse_qs(request.body)
self.assertEqual(
params['client_id'],
[providerInfo['client_id']['value']])
except (KeyError, AssertionError) as e:
return {
'status_code': 404,
'content': json.dumps({
'error': repr(e)
})
}
try:
for account in six.viewvalues(providerInfo['accounts']):
if account['auth_code'] == params['code'][0]:
break
else:
self.fail()
self.assertEqual(
params['client_secret'],
[providerInfo['client_secret']['value']])
self.assertRegexpMatches(
params['redirect_uri'][0],
providerInfo['allowed_callback_re'])
except (KeyError, AssertionError) as e:
returnBody = json.dumps({
'error': repr(e),
'error_description': repr(e)
})
else:
returnBody = json.dumps({
'token_type': 'bearer',
'access_token': account['access_token'],
'scope': 'user:email'
})
return {
'status_code': 200,
'headers': {
'Content-Type': 'application/json'
},
'content': returnBody
}
@httmock.urlmatch(scheme='https', netloc='^api.github.com$',
path='^/user$', method='GET')
def mockGithubApiUser(url, request):
try:
for account in six.viewvalues(providerInfo['accounts']):
if 'token %s' % account['access_token'] == \
request.headers['Authorization']:
break
else:
self.fail()
except AssertionError as e:
return {
'status_code': 401,
'content': json.dumps({
'message': repr(e)
})
}
return json.dumps({
'id': account['user']['oauth']['id'],
'login': account['user']['login'],
'name': '%s %s' % (account['user']['firstName'],
account['user']['lastName'])
})
@httmock.urlmatch(scheme='https', netloc='^api.github.com$',
path='^/user/emails$', method='GET')
def mockGithubApiEmail(url, request):
try:
for account in six.viewvalues(providerInfo['accounts']):
if 'token %s' % account['access_token'] == \
request.headers['Authorization']:
break
else:
self.fail()
except AssertionError as e:
return {
'status_code': 401,
'content': json.dumps({
'message': repr(e)
})
}
return json.dumps([
{
'primary': False,
'email': 'drago@siberia.ussr.gov',
'verified': True
}, {
'primary': True,
'email': account['user']['email'],
'verified': True
}
])
with httmock.HTTMock(
mockGithubRedirect,
mockGithubToken,
mockGithubApiUser,
mockGithubApiEmail,
# Must keep "mockOtherRequest" last
self.mockOtherRequest
):
self._testOauth(providerInfo)
def testLinkedinOauth(self): # noqa
providerInfo = {
'id': 'linkedin',
'name': 'LinkedIn',
'client_id': {
'key': PluginSettings.LINKEDIN_CLIENT_ID,
'value': 'linkedin_test_client_id'
},
'client_secret': {
'key': PluginSettings.LINKEDIN_CLIENT_SECRET,
'value': 'linkedin_test_client_secret'
},
'allowed_callback_re':
r'^http://127\.0\.0\.1(?::\d+)?'
r'/api/v1/oauth/linkedin/callback$',
'url_re': r'^https://www\.linkedin\.com/uas/oauth2/authorization',
'accounts': {
'existing': {
'auth_code': 'linkedin_existing_auth_code',
'access_token': 'linkedin_existing_test_token',
'user': {
'login': self.adminUser['login'],
'email': self.adminUser['email'],
'firstName': self.adminUser['firstName'],
'lastName': self.adminUser['lastName'],
'oauth': {
'provider': 'linkedin',
'id': '42kD-5H'
}
}
},
'new': {
'auth_code': 'linkedin_new_auth_code',
'access_token': 'linkedin_new_test_token',
'user': {
# this login is not provided by LinkedIn, but will be
# created internally by _deriveLogin
'login': 'clubber',
'email': 'clubber@streets.chi.il.us',
'firstName': 'James',
'lastName': 'Lang',
'oauth': {
'provider': 'linkedin',
'id': '634pity-fool4'
}
}
}
}
}
@httmock.urlmatch(scheme='https', netloc='^www.linkedin.com$',
path='^/uas/oauth2/authorization$', method='GET')
def mockLinkedinRedirect(url, request):
try:
params = urllib.parse.parse_qs(url.query)
self.assertEqual(
params['client_id'],
[providerInfo['client_id']['value']])
self.assertRegexpMatches(
params['redirect_uri'][0],
providerInfo['allowed_callback_re'])
except (KeyError, AssertionError) as e:
return {
'status_code': 200,
'content': json.dumps({
'error': repr(e)
})
}
try:
self.assertEqual(
params['response_type'],
['code'])
self.assertEqual(
params['scope'][0].split(' '),
['r_basicprofile', 'r_emailaddress'])
state = params['state'][0]
# Nothing to test for state, since provider doesn't care
except (KeyError, AssertionError) as e:
returnQuery = urllib.parse.urlencode({
'error': repr(e),
'error_description': repr(e)
})
else:
returnQuery = urllib.parse.urlencode({
'state': state,
'code':
providerInfo['accounts'][self.accountType]['auth_code']
})
return {
'status_code': 302,
'headers': {
'Location': '%s?%s' % (params['redirect_uri'][0],
returnQuery)
}
}
@httmock.urlmatch(scheme='https', netloc='^www.linkedin.com$',
path='^/uas/oauth2/accessToken$', method='POST')
def mockLinkedinToken(url, request):
try:
self.assertEqual(request.headers['Content-Type'],
'application/x-www-form-urlencoded')
params = urllib.parse.parse_qs(request.body)
self.assertEqual(
params['grant_type'],
['authorization_code'])
self.assertEqual(
params['client_id'],
[providerInfo['client_id']['value']])
for account in six.viewvalues(providerInfo['accounts']):
if account['auth_code'] == params['code'][0]:
break
else:
self.fail()
self.assertRegexpMatches(
params['redirect_uri'][0],
providerInfo['allowed_callback_re'])
except (KeyError, AssertionError) as e:
return {
'status_code': 400,
'content': json.dumps({
'error': repr(e),
'error_description': repr(e)
})
}
try:
self.assertEqual(
params['client_secret'],
[providerInfo['client_secret']['value']])
except (KeyError, AssertionError) as e:
return {
'status_code': 401,
'content': json.dumps({
'error': repr(e),
'error_description': repr(e)
})
}
return json.dumps({
'access_token': account['access_token'],
'expires_in': datetime.timedelta(days=60).seconds
})
@httmock.urlmatch(scheme='https', netloc='^api.linkedin.com$',
path='^/v1/people/~(?::\(.+\)?)$', method='GET')
def mockLinkedinApi(url, request):
try:
for account in six.viewvalues(providerInfo['accounts']):
if 'Bearer %s' % account['access_token'] == \
request.headers['Authorization']:
break
else:
self.fail()
except AssertionError as e:
return {
'status_code': 401,
'content': json.dumps({
'errorCode': 0,
'message': repr(e)
})
}
try:
fieldsRe = re.match(r'^.+:\((.+)\)$', url.path)
self.assertTrue(fieldsRe)
self.assertSetEqual(
set(fieldsRe.group(1).split(',')),
{'id', 'emailAddress', 'firstName', 'lastName'})
params = urllib.parse.parse_qs(url.query)
self.assertEqual(params['format'], ['json'])
except AssertionError as e:
return {
'status_code': 400,
'content': json.dumps({
'errorCode': 0,
'message': repr(e)
})
}
return json.dumps({
'id': account['user']['oauth']['id'],
'firstName': account['user']['firstName'],
'lastName': account['user']['lastName'],
'emailAddress': account['user']['email']
})
with httmock.HTTMock(
mockLinkedinRedirect,
mockLinkedinToken,
mockLinkedinApi,
# Must keep "mockOtherRequest" last
self.mockOtherRequest
):
self._testOauth(providerInfo)
| {
"content_hash": "88172e4488d0241bf8b95914f4d553ff",
"timestamp": "",
"source": "github",
"line_count": 930,
"max_line_length": 80,
"avg_line_length": 39.92043010752688,
"alnum_prop": 0.45835802402628884,
"repo_name": "essamjoubori/girder",
"id": "886ba16ab4380c081f2cb779ebf9f6fa0e43f3d4",
"size": "37920",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/oauth/plugin_tests/oauth_test.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CMake",
"bytes": "36635"
},
{
"name": "CSS",
"bytes": "156740"
},
{
"name": "HTML",
"bytes": "161646"
},
{
"name": "JavaScript",
"bytes": "1358011"
},
{
"name": "Mako",
"bytes": "1483"
},
{
"name": "Python",
"bytes": "1202837"
},
{
"name": "Ruby",
"bytes": "9923"
},
{
"name": "Shell",
"bytes": "3298"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Allg. Gartenzeitung 16:121. 1848
#### Original name
null
### Remarks
null | {
"content_hash": "b2a9fbbb15e9a50d328d27835fa8c9b8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 12.461538461538462,
"alnum_prop": 0.7098765432098766,
"repo_name": "mdoering/backbone",
"id": "ad01e73d47f2fd48fa96d71c4aaa18a71de54f43",
"size": "217",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Asparagaceae/Cordyline/Cordyline rubra/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
/**
* Detects for-loops that can be simplified to a while-loop.
*
* This rule is based on the PMD rule catalog. Detects for-loops that can be
* simplified as a while-loop.
*
* <code>
* class Foo
* {
* public function bar($x)
* {
* for (;true;) true; // No Init or Update part, may as well be: while (true)
* }
* }
* </code>
*
* @category PHP
* @package PHP_CodeSniffer
* @author Manuel Pichler <mapi@manuel-pichler.de>
* @copyright 2007-2008 Manuel Pichler. All rights reserved.
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
class Generic_Sniffs_CodeAnalysis_ForLoopShouldBeWhileLoopSniff implements PHP_CodeSniffer_Sniff
{
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return array(integer)
*/
public function register()
{
return array(T_FOR);
}//end register()
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
*
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$token = $tokens[$stackPtr];
// Skip invalid statement.
if (isset($token['parenthesis_opener']) === false) {
return;
}
$next = ++$token['parenthesis_opener'];
$end = --$token['parenthesis_closer'];
$parts = array(0, 0, 0);
$index = 0;
for (; $next <= $end; ++$next) {
$code = $tokens[$next]['code'];
if ($code === T_SEMICOLON) {
++$index;
} else if (in_array($code, PHP_CodeSniffer_Tokens::$emptyTokens) === false) {
++$parts[$index];
}
}
if ($parts[0] === 0 && $parts[2] === 0 && $parts[1] > 0) {
$error = 'This FOR loop can be simplified to a WHILE loop';
$phpcsFile->addWarning($error, $stackPtr, 'CanSimplify');
}
}//end process()
}//end class
?> | {
"content_hash": "2b1a60722ad6c337966e613761fd05d8",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 96,
"avg_line_length": 26.886363636363637,
"alnum_prop": 0.5511411665257819,
"repo_name": "dryabkov/PHP_CodeSniffer",
"id": "6112d24729b899cdee8a60318f870fb4e2c1b80a",
"size": "2813",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "33736"
},
{
"name": "PHP",
"bytes": "2060161"
},
{
"name": "Shell",
"bytes": "699"
}
],
"symlink_target": ""
} |
package seedu.today.commons.events.ui;
import seedu.today.commons.events.BaseEvent;
/**
* Indicates a request for App termination
*/
public class ExitAppRequestEvent extends BaseEvent {
@Override
public String toString() {
return this.getClass().getSimpleName();
}
}
| {
"content_hash": "696b7ee8363483817324757edf2ca624",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 52,
"avg_line_length": 20.857142857142858,
"alnum_prop": 0.7157534246575342,
"repo_name": "CS2103JAN2017-T09-B1/main",
"id": "5ab7590b1dd12b55c3a9c18845a819bbd08b1051",
"size": "292",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/seedu/today/commons/events/ui/ExitAppRequestEvent.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "22691"
},
{
"name": "HTML",
"bytes": "32420"
},
{
"name": "Java",
"bytes": "463472"
},
{
"name": "Shell",
"bytes": "1525"
}
],
"symlink_target": ""
} |
Requires [Apache Maven](http://maven.apache.org) 3.0 or greater, and JDK 6+ in order to run.
To build, run
mvn package
Building will run the tests, but to explicitly run tests you can use the test target
mvn test
To start the app, use the [App Engine Maven Plugin](http://code.google.com/p/appengine-maven-plugin/) that is already included in this demo. Just run the command.
mvn appengine:devserver
For further information, consult the [Java App Engine](https://developers.google.com/appengine/docs/java/overview) documentation.
To see all the available goals for the App Engine plugin, run
mvn help:describe -Dplugin=appengine | {
"content_hash": "303ada2f1c11c3af0c5a85b77fdda377",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 163,
"avg_line_length": 34.421052631578945,
"alnum_prop": 0.7553516819571865,
"repo_name": "jchurc16/groupqrproj",
"id": "2ee9945a3fd6bcbe515aad93cb02fab56a2e2bc0",
"size": "729",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "79684"
},
{
"name": "JavaScript",
"bytes": "567305"
},
{
"name": "Shell",
"bytes": "506"
}
],
"symlink_target": ""
} |
package Google::Ads::GoogleAds::V11::Enums::BidModifierSourceEnum;
use strict;
use warnings;
use Const::Exporter enums => [
UNSPECIFIED => "UNSPECIFIED",
UNKNOWN => "UNKNOWN",
CAMPAIGN => "CAMPAIGN",
AD_GROUP => "AD_GROUP"
];
1;
| {
"content_hash": "2640750f8ea908da564f6f1b65b8edb6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 66,
"avg_line_length": 19.23076923076923,
"alnum_prop": 0.648,
"repo_name": "googleads/google-ads-perl",
"id": "d35aae9131dc61097ddb4ef02627a2343c476fd5",
"size": "826",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "lib/Google/Ads/GoogleAds/V11/Enums/BidModifierSourceEnum.pm",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "73"
},
{
"name": "Perl",
"bytes": "5866064"
}
],
"symlink_target": ""
} |
<?php
/**
* PDF element factory interface.
* Responsibility is to log PDF changes
*
* @package Zend_Pdf
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Pdf_ElementFactory_Interface
{
/**
* Close factory and clean-up resources
*
* @internal
*/
public function close();
/**
* Get source factory object
*
* @return Zend_Pdf_ElementFactory
*/
public function resolve();
/**
* Get factory ID
*
* @return integer
*/
public function getId();
/**
* Set object counter
*
* @param integer $objCount
*/
public function setObjectCount($objCount);
/**
* Get object counter
*
* @return integer
*/
public function getObjectCount();
/**
* Attach factory to the current;
*
* @param Zend_Pdf_ElementFactory_Interface $factory
*/
public function attach(Zend_Pdf_ElementFactory_Interface $factory);
/**
* Calculate object enumeration shift.
*
* @param Zend_Pdf_ElementFactory_Interface $factory
* @return integer
*/
public function calculateShift(Zend_Pdf_ElementFactory_Interface $factory);
/**
* Clean enumeration shift cache.
* Has to be used after PDF render operation to let followed updates be correct.
*
* @param Zend_Pdf_ElementFactory_Interface $factory
* @return integer
*/
public function cleanEnumerationShiftCache();
/**
* Retrive object enumeration shift.
*
* @param Zend_Pdf_ElementFactory_Interface $factory
* @return integer
* @throws Zend_Pdf_Exception
*/
public function getEnumerationShift(Zend_Pdf_ElementFactory_Interface $factory);
/**
* Mark object as modified in context of current factory.
*
* @param Zend_Pdf_Element_Object $obj
* @throws Zend_Pdf_Exception
*/
public function markAsModified(Zend_Pdf_Element_Object $obj);
/**
* Remove object in context of current factory.
*
* @param Zend_Pdf_Element_Object $obj
* @throws Zend_Pdf_Exception
*/
public function remove(Zend_Pdf_Element_Object $obj);
/**
* Generate new Zend_Pdf_Element_Object
*
* @todo Reusage of the freed object. It's not a support of new feature, but only improvement.
*
* @param Zend_Pdf_Element $objectValue
* @return Zend_Pdf_Element_Object
*/
public function newObject(Zend_Pdf_Element $objectValue);
/**
* Generate new Zend_Pdf_Element_Object_Stream
*
* @todo Reusage of the freed object. It's not a support of new feature, but only improvement.
*
* @param mixed $objectValue
* @return Zend_Pdf_Element_Object_Stream
*/
public function newStreamObject($streamValue);
/**
* Enumerate modified objects.
* Returns array of Zend_Pdf_UpdateInfoContainer
*
* @param Zend_Pdf_ElementFactory $rootFactory
* @return array
*/
public function listModifiedObjects($rootFactory = null);
/**
* Check if PDF file was modified
*
* @return boolean
*/
public function isModified();
}
| {
"content_hash": "2a36b071a5c82eafa1c4b4cee92ba374",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 98,
"avg_line_length": 24.649253731343283,
"alnum_prop": 0.6267029972752044,
"repo_name": "Ezku/xi-framework",
"id": "11fc6ce5967e4b569012490097f72dad9e79522a",
"size": "4045",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "framework/vendor/Zend/Pdf/ElementFactory/Interface.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "20000"
},
{
"name": "PHP",
"bytes": "17590007"
}
],
"symlink_target": ""
} |
# Copyright (c) 2011 The LevelDB 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.
#-----------------------------------------------
# Uncomment exactly one of the lines labelled (A), (B), and (C) below
# to switch between compilation modes.
OPT ?= -O2 -DNDEBUG # (A) Production use (optimized mode)
# OPT ?= -g2 # (B) Debug mode, w/ full line-level debugging symbols
# OPT ?= -O2 -g2 -DNDEBUG # (C) Profiling mode: opt, but w/debugging symbols
#-----------------------------------------------
# detect what platform we're building on
$(shell CC="$(CC)" CXX="$(CXX)" TARGET_OS="$(TARGET_OS)" \
./build_detect_platform build_config.mk ./)
# this file is generated by the previous line to set build flags and sources
include build_config.mk
CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)
LDFLAGS += $(PLATFORM_LDFLAGS)
LIBS += $(PLATFORM_LIBS)
LIBOBJECTS = $(SOURCES:.cc=.o)
MEMENVOBJECTS = $(MEMENV_SOURCES:.cc=.o)
TESTUTIL = ./util/testutil.o
TESTHARNESS = ./util/testharness.o $(TESTUTIL)
TESTS = \
arena_test \
autocompact_test \
bloom_test \
c_test \
cache_test \
coding_test \
corruption_test \
crc32c_test \
db_test \
dbformat_test \
env_test \
filename_test \
filter_block_test \
issue178_test \
issue200_test \
log_test \
memenv_test \
skiplist_test \
table_test \
version_edit_test \
version_set_test \
write_batch_test
PROGRAMS = db_bench leveldbutil $(TESTS)
BENCHMARKS = db_bench_sqlite3 db_bench_tree_db
LIBRARY = libleveldb.a
MEMENVLIBRARY = libmemenv.a
default: all
# Should we build shared libraries?
ifneq ($(PLATFORM_SHARED_EXT),)
ifneq ($(PLATFORM_SHARED_VERSIONED),true)
SHARED1 = libleveldb.$(PLATFORM_SHARED_EXT)
SHARED2 = $(SHARED1)
SHARED3 = $(SHARED1)
SHARED = $(SHARED1)
else
# Update db.h if you change these.
SHARED_MAJOR = 1
SHARED_MINOR = 13
SHARED1 = libleveldb.$(PLATFORM_SHARED_EXT)
SHARED2 = $(SHARED1).$(SHARED_MAJOR)
SHARED3 = $(SHARED1).$(SHARED_MAJOR).$(SHARED_MINOR)
SHARED = $(SHARED1) $(SHARED2) $(SHARED3)
$(SHARED1): $(SHARED3)
ln -fs $(SHARED3) $(SHARED1)
$(SHARED2): $(SHARED3)
ln -fs $(SHARED3) $(SHARED2)
endif
$(SHARED3):
$(CXX) $(LDFLAGS) $(PLATFORM_SHARED_LDFLAGS)$(SHARED2) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(SOURCES) -o $(SHARED3) $(LIBS)
endif # PLATFORM_SHARED_EXT
all: $(SHARED) $(LIBRARY)
check: all $(PROGRAMS) $(TESTS)
for t in $(TESTS); do echo "***** Running $$t"; ./$$t || exit 1; done
clean:
-rm -f $(PROGRAMS) $(BENCHMARKS) $(LIBRARY) $(SHARED) $(MEMENVLIBRARY) */*.o */*/*.o ios-x86/*/*.o ios-arm/*/*.o build_config.mk
-rm -rf ios-x86/* ios-arm/*
$(LIBRARY): $(LIBOBJECTS)
rm -f $@
$(AR) -rs $@ $(LIBOBJECTS)
db_bench: db/db_bench.o $(LIBOBJECTS) $(TESTUTIL)
$(CXX) $(LDFLAGS) db/db_bench.o $(LIBOBJECTS) $(TESTUTIL) -o $@ $(LIBS)
db_bench_sqlite3: doc/bench/db_bench_sqlite3.o $(LIBOBJECTS) $(TESTUTIL)
$(CXX) $(LDFLAGS) doc/bench/db_bench_sqlite3.o $(LIBOBJECTS) $(TESTUTIL) -o $@ -lsqlite3 $(LIBS)
db_bench_tree_db: doc/bench/db_bench_tree_db.o $(LIBOBJECTS) $(TESTUTIL)
$(CXX) $(LDFLAGS) doc/bench/db_bench_tree_db.o $(LIBOBJECTS) $(TESTUTIL) -o $@ -lkyotocabinet $(LIBS)
leveldbutil: db/leveldb_main.o $(LIBOBJECTS)
$(CXX) $(LDFLAGS) db/leveldb_main.o $(LIBOBJECTS) -o $@ $(LIBS)
arena_test: util/arena_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) util/arena_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
autocompact_test: db/autocompact_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/autocompact_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
bloom_test: util/bloom_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) util/bloom_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
c_test: db/c_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/c_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
cache_test: util/cache_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) util/cache_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
coding_test: util/coding_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) util/coding_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
corruption_test: db/corruption_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/corruption_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
crc32c_test: util/crc32c_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) util/crc32c_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
db_test: db/db_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/db_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
dbformat_test: db/dbformat_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/dbformat_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
env_test: util/env_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) util/env_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
filename_test: db/filename_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/filename_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
filter_block_test: table/filter_block_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) table/filter_block_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
issue178_test: issues/issue178_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) issues/issue178_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
issue200_test: issues/issue200_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) issues/issue200_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
log_test: db/log_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/log_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
table_test: table/table_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) table/table_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
skiplist_test: db/skiplist_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/skiplist_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
version_edit_test: db/version_edit_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/version_edit_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
version_set_test: db/version_set_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/version_set_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
write_batch_test: db/write_batch_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) $(LDFLAGS) db/write_batch_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
$(MEMENVLIBRARY) : $(MEMENVOBJECTS)
rm -f $@
$(AR) -rs $@ $(MEMENVOBJECTS)
memenv_test : helpers/memenv/memenv_test.o $(MEMENVLIBRARY) $(LIBRARY) $(TESTHARNESS)
$(CXX) $(LDFLAGS) helpers/memenv/memenv_test.o $(MEMENVLIBRARY) $(LIBRARY) $(TESTHARNESS) -o $@ $(LIBS)
ifeq ($(PLATFORM), IOS)
# For iOS, create universal object files to be used on both the simulator and
# a device.
PLATFORMSROOT=/Applications/Xcode.app/Contents/Developer/Platforms
SIMULATORROOT=$(PLATFORMSROOT)/iPhoneSimulator.platform/Developer
DEVICEROOT=$(PLATFORMSROOT)/iPhoneOS.platform/Developer
IOSVERSION=$(shell defaults read $(PLATFORMSROOT)/iPhoneOS.platform/version CFBundleShortVersionString)
.cc.o:
mkdir -p ios-x86/$(dir $@)
$(CXX) $(CXXFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -c $< -o ios-x86/$@
mkdir -p ios-arm/$(dir $@)
xcrun -sdk iphoneos $(CXX) $(CXXFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@
lipo ios-x86/$@ ios-arm/$@ -create -output $@
.c.o:
mkdir -p ios-x86/$(dir $@)
$(CC) $(CFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -c $< -o ios-x86/$@
mkdir -p ios-arm/$(dir $@)
xcrun -sdk iphoneos $(CC) $(CFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@
lipo ios-x86/$@ ios-arm/$@ -create -output $@
else
.cc.o:
$(CXX) $(CXXFLAGS) -c $< -o $@
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
endif
| {
"content_hash": "6859144330cd8956e7de80758d668961",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 138,
"avg_line_length": 37.1588785046729,
"alnum_prop": 0.6690140845070423,
"repo_name": "virtacoinplus/virtacoinplus",
"id": "af9c08cff655cef6190ec56d25819a4c1f743d91",
"size": "7952",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/leveldb/Makefile",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "51312"
},
{
"name": "C",
"bytes": "705180"
},
{
"name": "C++",
"bytes": "2621786"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "HTML",
"bytes": "50620"
},
{
"name": "Makefile",
"bytes": "131855"
},
{
"name": "NSIS",
"bytes": "5914"
},
{
"name": "Objective-C",
"bytes": "858"
},
{
"name": "Objective-C++",
"bytes": "3536"
},
{
"name": "Python",
"bytes": "2819"
},
{
"name": "QMake",
"bytes": "15498"
},
{
"name": "Shell",
"bytes": "8660"
}
],
"symlink_target": ""
} |
//-----------------------------------------------------------------------
// <copyright file="MapperBase.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <author>Zhangwei Wu (criuswu@microsoft.com)</author>
//-----------------------------------------------------------------------
namespace HiveMapReduce.Prototype
{
using System;
using System.Collections.Generic;
/// <summary>
/// base class of mapper
/// </summary>
public abstract class MapperBase : ProcessBase
{
/// <summary>
/// map process method
/// </summary>
/// <param name="inputRows">input rows</param>
/// <param name="outputRow">reused output row, we should only yield return outputRow instance</param>
/// <param name="args">input args</param>
/// <returns>mapper result rows</returns>
public virtual IEnumerable<Row> Map(RowSet inputRows, Row outputRow, string[] args)
{
throw new NotImplementedException();
}
}
}
| {
"content_hash": "40baab8695cfc9019ee7567631f15683",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 109,
"avg_line_length": 37.03333333333333,
"alnum_prop": 0.5274527452745275,
"repo_name": "Zhangwei-WU/HiveTools",
"id": "3f97103b30efe6542f7c60be4ac19cf6c8ebd381",
"size": "1113",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "HiveTools/HiveMapReduce/Prototype/MapperBase.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "170744"
},
{
"name": "Smalltalk",
"bytes": "4082"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
<profile default="false" name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="true" />
<module name="hack-vm" />
</profile>
</annotationProcessing>
</component>
</project>
| {
"content_hash": "69fb1f8ad0a9f9edb84974f7b718e0a8",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 97,
"avg_line_length": 37.233333333333334,
"alnum_prop": 0.6168307967770814,
"repo_name": "Fantast/nand2tetris-implementation",
"id": "d773891c9f00e4187b32e9d2a600c8a9d6f07039",
"size": "1117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Chapter-07/HackVM/.idea/compiler.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ANTLR",
"bytes": "7230"
},
{
"name": "Assembly",
"bytes": "199858"
},
{
"name": "Java",
"bytes": "402175"
},
{
"name": "Scilab",
"bytes": "109943"
},
{
"name": "Shell",
"bytes": "504"
},
{
"name": "Smalltalk",
"bytes": "4797"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe EmailTemplatesHelper do
#Delete this example and add some real ones or delete this file
it "is included in the helper object" do
included_modules = (class << helper; self; end).send :included_modules
included_modules.should include(EmailTemplatesHelper)
end
end
| {
"content_hash": "2b10a77752111d463ea508e9797f27a0",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 74,
"avg_line_length": 28.181818181818183,
"alnum_prop": 0.7580645161290323,
"repo_name": "kathryn/eggs",
"id": "a59fab39bfc1a960e4e0f649f38cadfaa53f09ee",
"size": "310",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "spec/helpers/email_templates_helper_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "239039"
},
{
"name": "Ruby",
"bytes": "333584"
}
],
"symlink_target": ""
} |
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
$Id$
-->
</head>
<body bgcolor="white">
<p>
This package contains the classes that describe the structure of a
Java class file and a class file parser.
</p>
</body>
</html>
| {
"content_hash": "b27194d9668437b76851273c6c724f1d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 74,
"avg_line_length": 34.53333333333333,
"alnum_prop": 0.7442084942084942,
"repo_name": "tempbottle/commons-bcel",
"id": "e82c2d95a13c852a7447efb9bb08b673568e090d",
"size": "1036",
"binary": false,
"copies": "3",
"ref": "refs/heads/trunk",
"path": "src/main/java/org/apache/commons/bcel6/classfile/package.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "9598"
},
{
"name": "Java",
"bytes": "2459461"
},
{
"name": "Shell",
"bytes": "157"
}
],
"symlink_target": ""
} |
#!/usr/bin/env node
console.log("*******************************");
console.log("************ TECHN ************");
console.log("*******************************");
const amqp = require('amqplib/callback_api');
const args = process.argv.slice(2);
if (args.length === 0) {
console.log("Usage: node technician <joint>.* <joint>.*");
process.exit(1);
}
amqp.connect('amqp://localhost', function(err, conn) {
conn.createChannel(function(err, ch) {
const exchange = 'medical_examination';
const exchange_result = 'medical_examination_result';
const exchange_info = 'admin_info';
ch.assertExchange(exchange, 'topic', { durable: false }); // queue won't survive broker restarts
ch.assertExchange(exchange_result, 'topic', { durable: false }); // queue won't survive broker restarts
ch.assertExchange(exchange_info, 'fanout', { durable: false }); // queue won't survive broker restarts
/** Handle all examination types */
args.forEach(function(key) {
const pattern = key.split('.'); // [joint, any_lastname]
ch.assertQueue(pattern[0], { durable: false });
ch.prefetch(1); // load-balancing
ch.bindQueue(pattern[0], exchange, key);
console.log('[*] Waiting for logs. To exit press CTRL+C');
ch.consume(pattern[0], function(msg) {
console.log(`[RECEIVED] '${msg.content.toString()}'`);
const examinationData = msg.fields.routingKey.split('.'); // [joint, lastname]
const reply = `Mr/Mrs ${examinationData[1]}\'s medical examination result: ${examinationData[0].toUpperCase()} TWISTED`;
ch.publish(exchange_result, msg.properties.replyTo, new Buffer(reply));
console.log(`[SENT] '${reply}'`);
}, { noAck: true }); // don't send acknowledgement to doctor
});
/** Logs from admin */
ch.assertQueue('', { exclusive: true }, function(err, q) { // unique, temporary queue
ch.bindQueue(q.queue, exchange_info, 'log');
ch.consume(q.queue, function(msg) {
console.log(`[ADMIN] '${msg.content}'`);
}, { noAck: true });
});
});
}); | {
"content_hash": "cf2f4bbe65d0b6e01fd6b5a136063acf",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 136,
"avg_line_length": 45.14,
"alnum_prop": 0.5604785112981834,
"repo_name": "tguzik94/rabbitmq",
"id": "c758127a735ad5bf8b62b73d8d3fb1d89ca0fafb",
"size": "2257",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/technician.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "340"
},
{
"name": "JavaScript",
"bytes": "6640"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project name="metatype_annotations" default="all">
<dirname property="proj.dir" file="${ant.file.metatype_annotations}"/>
<property name="topdir" location="${proj.dir}/../../.."/>
<property name="api.pattern" value="org/osgi/service/metatype/annotations/**"/>
<property name = "bundle.build.lib" value = "false"/>
<property name = "bundle.build.api" value = "true"/>
<property name = "bundle.build.impl" value = "false"/>
<property name = "bundle.build.all" value = "false"/>
<path id="bundle.compile.path">
</path>
<import file="${topdir}/../ant/bundlebuild.xml"/>
</project>
| {
"content_hash": "e662629c34e6081c2ad13819b82e855f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 82,
"avg_line_length": 32.95,
"alnum_prop": 0.637329286798179,
"repo_name": "knopflerfish/knopflerfish.org",
"id": "7b9e3e779ce9ede6005516ca64dcfdb34011c092",
"size": "659",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "osgi/bundles/annotations/metatype_api/build.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "30451"
},
{
"name": "HTML",
"bytes": "402685"
},
{
"name": "Java",
"bytes": "12620016"
},
{
"name": "Shell",
"bytes": "6245"
},
{
"name": "XSLT",
"bytes": "25470"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Owin.Hosting;
namespace WebApiBook.Security.ResourceServer1
{
class Program
{
static void Main(string[] args)
{
const string baseUri = "http://resourceserver.example:8000";
Trace.Listeners.Add(new ConsoleTraceListener());
using (WebApp.Start<Startup>(new StartOptions(baseUri)))
{
Console.WriteLine("Application is started...");
Client.Run().Wait();
Console.ReadKey();
}
}
}
}
| {
"content_hash": "ff71c4f6d35fe44458e7e7bcf441eb69",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 72,
"avg_line_length": 27.24,
"alnum_prop": 0.6093979441997063,
"repo_name": "webapibook/WebApiBook.Security",
"id": "c47e3be575be62f46245fcbf81ff596bd8ed2682",
"size": "683",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/WebApiBook.Security.ResourceServer1/Program.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "105978"
},
{
"name": "Shell",
"bytes": "1700"
}
],
"symlink_target": ""
} |
<form method='post' action='{% url 'split_sample' uuid=sample.uuid piece=node.piece %}'>
{% csrf_token %}
<p><input id='split_number_{{node.piece}}' name='split_number_{{node.piece}}' type='number' class='form-control' placeholder='Final number of pieces (minimum 2)'></p>
<p><input id='split_comment_{{node.piece}}' name='split_comment_{{node.piece}}' type='text' class='form-control' placeholder='Comment...'</p>
<p><input id='submit_split_{{node.piece}}' type='submit' class='form-control btn btn-success'></p>
</form>
| {
"content_hash": "83a888e099e76dc86f8d9e864dd679e9",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 170,
"avg_line_length": 89.66666666666667,
"alnum_prop": 0.6635687732342007,
"repo_name": "wbg-optronix-lab/emergence-lab",
"id": "fb48f119bf7976f5c54d096848422daff5998b71",
"size": "538",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "templates/core/sample_split.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3909"
},
{
"name": "HTML",
"bytes": "239826"
},
{
"name": "JavaScript",
"bytes": "16743"
},
{
"name": "Python",
"bytes": "513490"
}
],
"symlink_target": ""
} |
package samples.junit4.mockpolicy;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.MockPolicy;
import org.powermock.core.spi.PowerMockPolicy;
import org.powermock.mockpolicies.MockPolicyClassLoadingSettings;
import org.powermock.mockpolicies.MockPolicyInterceptionSettings;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
import samples.mockpolicy.ResultCalculator;
import samples.mockpolicy.SimpleClassWithADependency;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import static org.junit.Assert.assertEquals;
import static org.powermock.api.easymock.PowerMock.verifyAll;
import static org.powermock.api.support.membermodification.MemberMatcher.method;
@RunWith(PowerMockRunner.class)
@MockPolicy(MockPolicyInvocationHandlerExample.class)
public class MockPolicyWithInvocationHandlerTest {
@Test
public void mockPolicyWithInvocationHandlerWorks() throws Exception {
final SimpleClassWithADependency tested = new SimpleClassWithADependency();
Whitebox.setInternalState(tested, new ResultCalculator(0));
assertEquals(1.0, tested.getResult(), 0.0);
verifyAll();
}
}
class MockPolicyInvocationHandlerExample implements PowerMockPolicy {
@Override
public void applyClassLoadingPolicy(MockPolicyClassLoadingSettings settings) {
settings.addFullyQualifiedNamesOfClassesToLoadByMockClassloader(ResultCalculator.class.getName());
}
@Override
public void applyInterceptionPolicy(MockPolicyInterceptionSettings settings) {
settings.proxyMethod(method(ResultCalculator.class), new InvocationHandler() {
@Override
public Object invoke(Object object, Method method, Object[] args) throws Throwable {
final double result = (Double) method.invoke(object, args);
return result + 1.0;
}
});
}
}
| {
"content_hash": "1aedb3826925615e90fa8232b8614536",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 100,
"avg_line_length": 34.872727272727275,
"alnum_prop": 0.8018769551616267,
"repo_name": "thekingnothing/powermock",
"id": "3f75a6d866546dde4290908713070ae2639469e3",
"size": "2547",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/module-test/easymock/junit4-test/src/test/java/samples/junit4/mockpolicy/MockPolicyWithInvocationHandlerTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "26032"
},
{
"name": "Java",
"bytes": "4308463"
},
{
"name": "Shell",
"bytes": "842"
}
],
"symlink_target": ""
} |
package org.springframework.boot.ansi;
import org.junit.After;
import org.junit.Test;
import org.springframework.boot.ansi.AnsiOutput.Enabled;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link AnsiPropertySource}.
*
* @author Phillip Webb
*/
public class AnsiPropertySourceTests {
private AnsiPropertySource source = new AnsiPropertySource("ansi", false);
@After
public void reset() {
AnsiOutput.setEnabled(Enabled.DETECT);
}
@Test
public void getAnsiStyle() throws Exception {
assertThat(this.source.getProperty("AnsiStyle.BOLD")).isEqualTo(AnsiStyle.BOLD);
}
@Test
public void getAnsiColor() throws Exception {
assertThat(this.source.getProperty("AnsiColor.RED")).isEqualTo(AnsiColor.RED);
}
@Test
public void getAnsiBackground() throws Exception {
assertThat(this.source.getProperty("AnsiBackground.GREEN"))
.isEqualTo(AnsiBackground.GREEN);
}
@Test
public void getAnsi() throws Exception {
assertThat(this.source.getProperty("Ansi.BOLD")).isEqualTo(AnsiStyle.BOLD);
assertThat(this.source.getProperty("Ansi.RED")).isEqualTo(AnsiColor.RED);
assertThat(this.source.getProperty("Ansi.BG_RED")).isEqualTo(AnsiBackground.RED);
}
@Test
public void getMissing() throws Exception {
assertThat(this.source.getProperty("AnsiStyle.NOPE")).isNull();
}
@Test
public void encodeEnabled() throws Exception {
AnsiOutput.setEnabled(Enabled.ALWAYS);
AnsiPropertySource source = new AnsiPropertySource("ansi", true);
assertThat(source.getProperty("Ansi.RED")).isEqualTo("\033[31m");
}
@Test
public void encodeDisabled() throws Exception {
AnsiOutput.setEnabled(Enabled.NEVER);
AnsiPropertySource source = new AnsiPropertySource("ansi", true);
assertThat(source.getProperty("Ansi.RED")).isEqualTo("");
}
}
| {
"content_hash": "3232948a5ba8d58990ed98c7a5a79932",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 83,
"avg_line_length": 26.441176470588236,
"alnum_prop": 0.7552836484983315,
"repo_name": "vakninr/spring-boot",
"id": "377d469f36da065e1baa03b6617cdb1952099530",
"size": "2418",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ansi/AnsiPropertySourceTests.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "4994"
},
{
"name": "CSS",
"bytes": "5769"
},
{
"name": "FreeMarker",
"bytes": "3599"
},
{
"name": "Groovy",
"bytes": "49244"
},
{
"name": "HTML",
"bytes": "69157"
},
{
"name": "Java",
"bytes": "11663384"
},
{
"name": "JavaScript",
"bytes": "37789"
},
{
"name": "Ruby",
"bytes": "1307"
},
{
"name": "Shell",
"bytes": "30125"
},
{
"name": "Smarty",
"bytes": "2885"
},
{
"name": "XSLT",
"bytes": "36072"
}
],
"symlink_target": ""
} |
#ifndef _STORYBOARD_H
#define _STORYBOARD_H
/* available scenes */
typedef enum scenetype_t {
SCENE_INTRO,
SCENE_LEVEL,
SCENE_PAUSE,
SCENE_GAMEOVER,
SCENE_QUEST,
SCENE_CONFIRMBOX,
SCENE_LANGSELECT,
SCENE_CREDITS,
SCENE_CREDITS2,
SCENE_OPTIONS,
SCENE_STAGESELECT,
SCENE_QUESTSELECT,
SCENE_EDITORHELP
} scenetype_t;
/* Storyboard */
void storyboard_init();
void storyboard_release();
struct scene_t* storyboard_get_scene(scenetype_t type);
#endif
| {
"content_hash": "39af41439611c4bf9b3858dc8b1dc567",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 55,
"avg_line_length": 17.928571428571427,
"alnum_prop": 0.6872509960159362,
"repo_name": "asirnayeef23/opensurge",
"id": "52251b85ff775b1b6cfcad63de56637abcf42a6a",
"size": "1419",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/core/storyboard.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2046265"
},
{
"name": "C++",
"bytes": "2603"
}
],
"symlink_target": ""
} |
use std::ffi::CStr;
use std::fmt;
use std::str;
/// The string wrapper from Exempi.
///
/// It is meant to be used for output parameter. But gives you ownership of the string.
/// Because of the way the C API of Exempi is implemented, we provide
/// this type instead of using std::string::String to avoid copying of strings
/// until needed.
/// They are mostly returned in an Option<XmpString> enum.
/// XmpString support several of the standard traits.
///
/// ```no_run
/// use exempi2::{Xmp,PropFlags};
///
/// let xmp = Xmp::new();
/// let mut flags = PropFlags::empty();
///
/// if let Ok(ref xmpstring) = xmp.get_property("http://rust.figuiere.net/ns/rust/", "rust", &mut flags) {
/// println!("property value is {}, flags {}", xmpstring, flags.bits());
/// println!("string len: {}", xmpstring.len());
/// let s = String::from(xmpstring);
/// println!("converted to std::String: {}", s);
/// }
/// ```
#[derive(Debug)]
pub struct XmpString(*mut c::XmpString);
impl Default for XmpString {
/// Default XmpString is allocated and ready to use
fn default() -> XmpString {
XmpString(unsafe { c::xmp_string_new() })
}
}
impl XmpString {
/// Create a new XmpString
pub fn new() -> XmpString {
XmpString::default()
}
/// Native pointer is NULL
pub fn is_null(&self) -> bool {
self.0.is_null()
}
/// Return the native pointer
pub fn as_ptr(&self) -> *const c::XmpString {
self.0
}
/// Return the mutable native pointer
pub fn as_mut_ptr(&mut self) -> *mut c::XmpString {
self.0
}
/// Return the length of the string
pub fn len(&self) -> usize {
if self.0.is_null() {
return 0;
}
unsafe { c::xmp_string_len(self.0) }
}
pub fn is_empty(&self) -> bool {
self.len() == 0
}
/// Convert to a str
// XXX properly deal with the utf8 error
pub fn to_str(&self) -> Option<&str> {
unsafe {
let s = CStr::from_ptr(c::xmp_string_cstr(self.0));
// we are supposed to receive UTF8 from the library.
str::from_utf8(s.to_bytes()).ok()
}
}
}
impl From<&XmpString> for String {
/// Convert an XmpString safely to string.
/// The result is lossy in it is not utf-8.
fn from(s: &XmpString) -> String {
unsafe {
let s = CStr::from_ptr(c::xmp_string_cstr(s.0));
// we are supposed to receive UTF8 from the library.
// be we'll play it safe.
String::from_utf8_lossy(s.to_bytes()).to_string()
}
}
}
impl Drop for XmpString {
/// Will deallocate properly the underlying object
fn drop(&mut self) {
if !self.is_null() {
unsafe { c::xmp_string_free(self.0) };
}
}
}
impl Eq for XmpString {}
impl PartialEq for XmpString {
fn eq(&self, other: &XmpString) -> bool {
self.to_str() == other.to_str()
}
}
impl fmt::Display for XmpString {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", String::from(self))
}
}
#[cfg(test)]
mod test {
use super::XmpString;
#[test]
fn test_xmpstring() {
let s = XmpString::default();
assert!(!s.is_null());
assert!(s.is_empty());
assert_eq!(s.len(), 0);
let s2 = XmpString::new();
assert_eq!(s, s2);
let string = String::from(&s2);
assert_eq!(string, "".to_owned());
}
}
| {
"content_hash": "d70b87e59c24c4a6ea30d9967b8161bd",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 106,
"avg_line_length": 26.03731343283582,
"alnum_prop": 0.5609057036400115,
"repo_name": "hfiguiere/exempi-rs",
"id": "7bdb99c106459dff67400762e00b3a64f9494fae",
"size": "3600",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/xmpstring.rs",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Rust",
"bytes": "67585"
}
],
"symlink_target": ""
} |
<?php
namespace Infect\BackendBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class GroupingControllerTest extends WebTestCase
{
/*
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = static::createClient();
// Create a new entry in the database
$crawler = $client->request('GET', '/grouping/');
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /grouping/");
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
// Fill in the form and submit it
$form = $crawler->selectButton('Create')->form(array(
'infect_backendbundle_groupingtype[field_name]' => 'Test',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check data in the show view
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
// Edit the entity
$crawler = $client->click($crawler->selectLink('Edit')->link());
$form = $crawler->selectButton('Edit')->form(array(
'infect_backendbundle_groupingtype[field_name]' => 'Foo',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
// Delete the entity
$client->submit($crawler->selectButton('Delete')->form());
$crawler = $client->followRedirect();
// Check the entity has been delete on the list
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
}
*/
}
| {
"content_hash": "39e5bd28a3b856fae20b74d81f26446c",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 125,
"avg_line_length": 35.58181818181818,
"alnum_prop": 0.6070516096065406,
"repo_name": "joinbox/infect",
"id": "e4771c09991ca25704f706e858ec275ccb3fdfb3",
"size": "1957",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/src/Infect/BackendBundle/Tests/Controller/GroupingControllerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "2651"
},
{
"name": "CSS",
"bytes": "293172"
},
{
"name": "HTML",
"bytes": "231940"
},
{
"name": "JavaScript",
"bytes": "71229"
},
{
"name": "PHP",
"bytes": "292686"
},
{
"name": "Shell",
"bytes": "3671"
}
],
"symlink_target": ""
} |
import { Schema, arrayOf } from 'normalizr';
// Define a schema for our entities.
// More info about normalizr Schemas you can find here: https://github.com/paularmstrong/normalizr
const match = new Schema('matches');
export default {
MATCH: match,
MATCHES: arrayOf(match)
};
| {
"content_hash": "99bc0d0c94499eb2c7991cfc7bf7cf70",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 98,
"avg_line_length": 28.2,
"alnum_prop": 0.7304964539007093,
"repo_name": "itsmepetrov/football-react-native-test-client",
"id": "ee80432c3cf5d69e8b360b5df8cee7547fc9d9ef",
"size": "282",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/api/schemas.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1042"
},
{
"name": "JavaScript",
"bytes": "30929"
},
{
"name": "Objective-C",
"bytes": "5144"
},
{
"name": "Python",
"bytes": "1652"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnnuaireCertifies.BackOffice.Web.ViewModels.Pages.Administration.LienExterne.Details
{
public class LienExterneViewModel
{
public long ID { get; set; }
public string Code { get; set; }
public string CodeEchange { get; set; }
public string Description { get; set; }
public string Url { get; set; }
}
}
| {
"content_hash": "07f5e3fe2ba3e93c462788ff22916c4e",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 94,
"avg_line_length": 29.294117647058822,
"alnum_prop": 0.6646586345381527,
"repo_name": "apo-j/Projects_Working",
"id": "761e20d7cb2d45c3b16e1e41615e103a827a1966",
"size": "500",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AC/AnnuaireCertifies/AC.BackOffice/AnnuaireCertifies.BackOffice.Web.ViewModels/Pages/Administration/LienExterne/Details/InforsGenerales/LienExterneViewModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "16118"
},
{
"name": "Batchfile",
"bytes": "1096"
},
{
"name": "C#",
"bytes": "27262375"
},
{
"name": "CSS",
"bytes": "8474090"
},
{
"name": "Groff",
"bytes": "2101703"
},
{
"name": "HTML",
"bytes": "4910101"
},
{
"name": "JavaScript",
"bytes": "20716565"
},
{
"name": "PHP",
"bytes": "9283"
},
{
"name": "XSLT",
"bytes": "930531"
}
],
"symlink_target": ""
} |
<h1 style="position:absolute;top:250px;left:250px;"> Thank You For Your Order</h1> | {
"content_hash": "089599c720c976750e0e08dc67cb7a33",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 82,
"avg_line_length": 82,
"alnum_prop": 0.7560975609756098,
"repo_name": "exhibia/exhibia",
"id": "badbad52ff8630c13229f15692cf412ba6bb6be3",
"size": "87",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/gateways/payment_success.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "9307"
},
{
"name": "JavaScript",
"bytes": "126410"
},
{
"name": "PHP",
"bytes": "2449281"
},
{
"name": "Shell",
"bytes": "2611"
}
],
"symlink_target": ""
} |
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePaperQuestionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('paper_questions', function (Blueprint $table) {
$table->increments('id');
$table->string('question');
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users');
$table->boolean('confirmed_real')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('paper_questions');
}
}
| {
"content_hash": "99d7b30e3f6ae4d16fce5bb5d3ecf6b0",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 71,
"avg_line_length": 23.914285714285715,
"alnum_prop": 0.5675029868578255,
"repo_name": "maccery/pastpapers",
"id": "7aad7f3a4bb1456a07af18a4630dbb50f69aa02c",
"size": "837",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "database/migrations/2017_04_27_231454_create_paper_questions_table.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "553"
},
{
"name": "CSS",
"bytes": "5368"
},
{
"name": "HTML",
"bytes": "55370"
},
{
"name": "JavaScript",
"bytes": "1052"
},
{
"name": "PHP",
"bytes": "150430"
},
{
"name": "Vue",
"bytes": "561"
}
],
"symlink_target": ""
} |
<?php
namespace frontend\models;
use common\models\Warehouse;
use yii\base\Model;
use common\models\User;
use common\models\MEMBINFO;
use yii\validators\Validator;
/**
* Signup form
*/
class SignupForm extends Model
{
public $username;
public $email;
public $password;
public $nickname;
public $confirm_password;
public $question_id;
public $answer;
public $server;
/**
* @inheritdoc
*/
public function rules()
{
return [
['server', 'integer'],
['server', 'required'],
['username', 'trim'],
['username', 'required'],
['username', 'unique', 'targetClass' => '\common\models\MEMBINFO', 'targetAttribute'=>'memb___id', 'message' => 'This username has already been taken.'],
['username', 'string', 'min' => 2, 'max' => 255],
['nickname', 'trim'],
['nickname', 'required'],
['nickname', 'string', 'min' => 2, 'max' => 255],
['email', 'trim'],
['email', 'required'],
['email', 'email'],
['email', 'string', 'max' => 255],
['email', 'unique', 'targetClass' => '\common\models\MEMBINFO','targetAttribute'=>'mail_addr', 'message' => 'This email address has already been taken.'],
[['password','confirm_password'], 'required'],
[['password','confirm_password'], 'string', 'min' => 6],
['confirm_password', 'compare', 'compareAttribute' => 'password', 'operator' => '===']
];
}
public function attributeLabels()
{
return [
'username' => '用户名',
'email' => '邮箱地址',
'password' => '密码',
'nickname' => '昵称',
'confirm_password' => '确认密码',
'server'=>'游戏区'
];
}
/**
* Signs user up.
*
* @return User|null the saved model or null if saving fails
*/
public function signup()
{
// var_dump(Validator::$builtInValidators);
if (!$this->validate()) {
return null;
}
// die($this->username);
$user = new MEMBINFO();
$user->ServerCode = $this->server;
$user->memb___id = $this->username;//$this->username是指在signupform的數據,而$user->username則是表示user表中的一個字段
$user->mail_addr = $this->email;
$user->setPassword($this->password);
$user->memb_name = $this->nickname;
$user->sno__numb = "1111111111111";
$user->bloc_code = '0';
$user->ctl1_code = '0';
// $user->generateAuthKey();
// var_dump(json_encode($user));
return $user->save() ? $user : null;
}
}
| {
"content_hash": "4d14fa3d24beaf6f0bd496a9a49342e8",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 166,
"avg_line_length": 26.46078431372549,
"alnum_prop": 0.5113004816598741,
"repo_name": "Slowbroer/games",
"id": "7c468c5e1fdbe42b877c9d843c79b1a055241c54",
"size": "2773",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/models/SignupForm.php",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "56209"
},
{
"name": "JavaScript",
"bytes": "2645"
},
{
"name": "PHP",
"bytes": "424272"
},
{
"name": "Shell",
"bytes": "3257"
}
],
"symlink_target": ""
} |
@interface SINPostStatusService : LMJBaseRequest
- (void)retweetText:(NSString *)postText images:(NSArray<UIImage *> *)images completion:(void(^)(BOOL isSucceed))completion;
@end
| {
"content_hash": "5eec3cdf1c3b550e0864ea6091223cef",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 124,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.7692307692307693,
"repo_name": "NJHu/PLMMPrjk",
"id": "18310895b7c4d55d2b672c80dce4626c8212d16a",
"size": "354",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iOSProject/iOSProject/Classes/新浪微博/Service/SINPostStatusService.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3884"
},
{
"name": "HTML",
"bytes": "7741"
},
{
"name": "JavaScript",
"bytes": "9900"
},
{
"name": "Objective-C",
"bytes": "7221492"
},
{
"name": "Ruby",
"bytes": "1558"
},
{
"name": "Shell",
"bytes": "10753"
},
{
"name": "Swift",
"bytes": "5016"
}
],
"symlink_target": ""
} |
#ifndef CLICK_LISTTEST_HH
#define CLICK_LISTTEST_HH
#include <click/element.hh>
CLICK_DECLS
/*
=c
ListTest()
=s test
runs regression tests for List<T, link>
=d
ListTest runs List regression tests at initialization time. It does not route
packets.
*/
class ListTest : public Element { public:
ListTest();
~ListTest();
const char *class_name() const { return "ListTest"; }
int initialize(ErrorHandler *errh);
};
CLICK_ENDDECLS
#endif
| {
"content_hash": "07a9081bf378319680d31a6bfb86b8d4",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 77,
"avg_line_length": 13.588235294117647,
"alnum_prop": 0.6991341991341992,
"repo_name": "nfvproject/TFM",
"id": "8867d05545a3e45f035335660a7285592ff53795",
"size": "462",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "TFM/click-2.0.1/elements/test/listtest.hh",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "748936"
},
{
"name": "C++",
"bytes": "4064670"
},
{
"name": "Click",
"bytes": "617"
},
{
"name": "GLSL",
"bytes": "111415"
},
{
"name": "Java",
"bytes": "259345"
},
{
"name": "Makefile",
"bytes": "10143"
},
{
"name": "Perl",
"bytes": "76048"
},
{
"name": "Python",
"bytes": "26040"
},
{
"name": "Roff",
"bytes": "8537"
},
{
"name": "Shell",
"bytes": "17081"
},
{
"name": "Standard ML",
"bytes": "1140689"
}
],
"symlink_target": ""
} |
This sample demonstrates how to analyze text, field values, selection marks, and table data from custom documents. Custom models are trained with your own data, so they're tailored to your documents. For more information on how to do the training, see [build a model][build_a_model].
To get started you'll need a Cognitive Services resource or a Form Recognizer resource. See [README][README] for prerequisites and instructions.
## Creating a `DocumentAnalysisClient`
To create a new `DocumentAnalysisClient` you need the endpoint and credentials from your resource. In the sample below you'll use a Form Recognizer API key credential by creating an `AzureKeyCredential` object, that if needed, will allow you to update the API key without creating a new client.
You can set `endpoint` and `apiKey` based on an environment variable, a configuration setting, or any way that works for your application.
```C# Snippet:CreateDocumentAnalysisClient
string endpoint = "<endpoint>";
string apiKey = "<apiKey>";
var credential = new AzureKeyCredential(apiKey);
var client = new DocumentAnalysisClient(new Uri(endpoint), credential);
```
## Use a custom model to analyze a document from a URI
To analyze a given file at a URI, use the `StartAnalyzeDocumentFromUri` method. The returned value is an `AnalyzeResult` object containing data about the submitted document.
```C# Snippet:FormRecognizerAnalyzeWithCustomModelFromUriAsync
string modelId = "<modelId>";
string fileUri = "<fileUri>";
AnalyzeDocumentOperation operation = await client.StartAnalyzeDocumentFromUriAsync(modelId, fileUri);
await operation.WaitForCompletionAsync();
AnalyzeResult result = operation.Value;
Console.WriteLine($"Document was analyzed with model with ID: {result.ModelId}");
foreach (AnalyzedDocument document in result.Documents)
{
Console.WriteLine($"Document of type: {document.DocType}");
foreach (KeyValuePair<string, DocumentField> fieldKvp in document.Fields)
{
string fieldName = fieldKvp.Key;
DocumentField field = fieldKvp.Value;
Console.WriteLine($"Field '{fieldName}': ");
Console.WriteLine($" Content: '{field.Content}'");
Console.WriteLine($" Confidence: '{field.Confidence}'");
}
}
```
## Use a custom model to analyze a document from a file stream
To analyze a given file at a file stream, use the `StartAnalyzeDocument` method. The returned value is an `AnalyzeResult` object containing data about the submitted document.
```C# Snippet:FormRecognizerAnalyzeWithCustomModelFromFileAsync
string modelId = "<modelId>";
string filePath = "<filePath>";
using var stream = new FileStream(filePath, FileMode.Open);
AnalyzeDocumentOperation operation = await client.StartAnalyzeDocumentAsync(modelId, stream);
await operation.WaitForCompletionAsync();
AnalyzeResult result = operation.Value;
Console.WriteLine($"Document was analyzed with model with ID: {result.ModelId}");
foreach (AnalyzedDocument document in result.Documents)
{
Console.WriteLine($"Document of type: {document.DocType}");
foreach (KeyValuePair<string, DocumentField> fieldKvp in document.Fields)
{
string fieldName = fieldKvp.Key;
DocumentField field = fieldKvp.Value;
Console.WriteLine($"Field '{fieldName}': ");
Console.WriteLine($" Content: '{field.Content}'");
Console.WriteLine($" Confidence: '{field.Confidence}'");
}
}
```
To see the full example source files, see:
* [Analyze with custom model from URI](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample_AnalyzeWithCustomModelFromUriAsync.cs)
* [Analyze with custom model from file](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample_AnalyzeWithCustomModelFromFileAsync.cs)
[README]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer#getting-started
[build_a_model]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/Sample_BuildCustomModel.md
| {
"content_hash": "3a35400592624912dcd0bd4782a1174e",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 294,
"avg_line_length": 44.94565217391305,
"alnum_prop": 0.7649334945586457,
"repo_name": "AsrOneSdk/azure-sdk-for-net",
"id": "19e342e1ece1dec8a863c064f375447488fc0c21",
"size": "4177",
"binary": false,
"copies": "1",
"ref": "refs/heads/psSdkJson6Current",
"path": "sdk/formrecognizer/Azure.AI.FormRecognizer/samples/Sample_AnalyzeWithCustomModel.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "15473"
},
{
"name": "Bicep",
"bytes": "13438"
},
{
"name": "C#",
"bytes": "72203239"
},
{
"name": "CSS",
"bytes": "6089"
},
{
"name": "Dockerfile",
"bytes": "5652"
},
{
"name": "HTML",
"bytes": "6169271"
},
{
"name": "JavaScript",
"bytes": "16012"
},
{
"name": "PowerShell",
"bytes": "649218"
},
{
"name": "Shell",
"bytes": "31287"
},
{
"name": "Smarty",
"bytes": "11135"
}
],
"symlink_target": ""
} |
package config.beans;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import config.spring.ProjectBeanPostProcessor;
import controller.ErrorControllerImpl;
import controller.NotFoundControllerImpl;
import web.common.ErrorController;
import web.common.NotFoundController;
@Configuration
public class SpringConfig {
@Bean
public BeanPostProcessor getBeanPostProcessor() {
return new ProjectBeanPostProcessor();
}
@Bean
public ErrorController getErrorController() {
return new ErrorControllerImpl();
}
@Bean
public NotFoundController getNotFoundController() {
return new NotFoundControllerImpl();
}
}
| {
"content_hash": "e1772dd9ffb0b00fb43fa17a4f5e186d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 66,
"avg_line_length": 26.533333333333335,
"alnum_prop": 0.7801507537688442,
"repo_name": "csutorasa/spring",
"id": "bece6198afd66339e0634a423fcaea870bcee175",
"size": "796",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Application/src/main/java/config/beans/SpringConfig.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "159"
},
{
"name": "HTML",
"bytes": "229"
},
{
"name": "Java",
"bytes": "76924"
},
{
"name": "JavaScript",
"bytes": "1114"
},
{
"name": "TypeScript",
"bytes": "6875"
}
],
"symlink_target": ""
} |
The tracking issue for this feature is: [#83701]
[#83701]: https://github.com/rust-lang/rust/issues/83701
------------------------
The `explicit_generic_args_with_impl_trait` feature gate lets you specify generic arguments even
when `impl Trait` is used in argument position.
A simple example is:
```rust
#![feature(explicit_generic_args_with_impl_trait)]
fn foo<T: ?Sized>(_f: impl AsRef<T>) {}
fn main() {
foo::<str>("".to_string());
}
```
This is currently rejected:
```text
error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
--> src/main.rs:6:11
|
6 | foo::<str>("".to_string());
| ^^^ explicit generic argument not allowed
```
However it would compile if `explicit_generic_args_with_impl_trait` is enabled.
Note that the synthetic type parameters from `impl Trait` are still implicit and you
cannot explicitly specify these:
```rust,compile_fail
#![feature(explicit_generic_args_with_impl_trait)]
fn foo<T: ?Sized>(_f: impl AsRef<T>) {}
fn bar<T: ?Sized, F: AsRef<T>>(_f: F) {}
fn main() {
bar::<str, _>("".to_string()); // Okay
bar::<str, String>("".to_string()); // Okay
foo::<str>("".to_string()); // Okay
foo::<str, String>("".to_string()); // Error, you cannot specify `impl Trait` explicitly
}
```
| {
"content_hash": "4398336afd007e9b84b2f545e603518f",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 102,
"avg_line_length": 25.80392156862745,
"alnum_prop": 0.6466565349544073,
"repo_name": "graydon/rust",
"id": "479571d85fe0510f5bf16730230f6bcbfed972cf",
"size": "1359",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/doc/unstable-book/src/language-features/explicit-generic-args-with-impl-trait.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "4990"
},
{
"name": "Assembly",
"bytes": "20064"
},
{
"name": "Awk",
"bytes": "159"
},
{
"name": "Bison",
"bytes": "78848"
},
{
"name": "C",
"bytes": "725899"
},
{
"name": "C++",
"bytes": "55803"
},
{
"name": "CSS",
"bytes": "22181"
},
{
"name": "JavaScript",
"bytes": "36295"
},
{
"name": "LLVM",
"bytes": "1587"
},
{
"name": "Makefile",
"bytes": "227056"
},
{
"name": "Puppet",
"bytes": "16300"
},
{
"name": "Python",
"bytes": "142548"
},
{
"name": "RenderScript",
"bytes": "99815"
},
{
"name": "Rust",
"bytes": "18342682"
},
{
"name": "Shell",
"bytes": "269546"
},
{
"name": "TeX",
"bytes": "57"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>W28730_text</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div style="margin-left: auto; margin-right: auto; width: 800px; overflow: hidden;">
<div style="float: left;">
<a href="page3.html">«</a>
</div>
<div style="float: right;">
</div>
</div>
<hr/>
<div style="position: absolute; margin-left: 137px; margin-top: 82px;">
<p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">) <br/>DXY <br/>( </p>
</div>
<div style="position: absolute; margin-left: 272px; margin-top: 136px;">
<p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">OXY USA Inc. <br/>A subsidiary oi Occidental Pelroleurn Cotpuraiion </p>
</div>
<div style="position: absolute; margin-left: 302px; margin-top: 495px;">
<p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Statement that OXY USA Inc. Shall not Use Diesel Fuel During Hydraulic Fracturing Operations <br/>By my signature below, I hereby attest that I am an employee of OXY USA Inc. (“OXY”) and I have the authority to state that to the best of my knowledge, for any hydraulic fi'acturing operations at any well operated by OXY or OXY Little Knife, LLC, OXY will not use diesel fuel in the form of any compound identified with the following Chemical Abstract Service Registry Numbers: </p>
</div>
<div style="position: absolute; margin-left: 275px; margin-top: 880px;">
<p class="styleSans17.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">68334-30-5 (Primary Name: Fuels, diesel) 68476-34-6 (Primary Name: Fuels, diesel, No. 2) 68476-30-2 (Primary Name: Fuel oil No. 2) 68476-31-3 (Primary Name: Fuel oil, No. 4) 8008-20-6 (Primary Name: Kerosene) <br/>I further attest that OXY acknowledges than it must obtain an Underground Injection Control, Class II permit, from the North Dakota Industrial Commission prior to commencing any Hydraulic Fracturing stimulation in which any amount of diesel fuel is injected. <br/>OXY USA WTP LP <br/>J <br/>B3" ‘ Date: W4? </p>
</div>
<div style="position: absolute; margin-left: 440px; margin-top: 1705px;">
<p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">that? S. Bush-[vie Reg atory Advisor </p>
</div>
<div style="position: absolute; margin-left: 275px; margin-top: 1842px;">
<p class="styleSans24.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SUBSCRIBED AND SWORN to before me this lbwfiday of WW 6&1 2014. <br/> </p>
</div>
<div style="position: absolute; margin-left: 1182px; margin-top: 1980px;">
<p class="styleSans17.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">M505 <br/>Notary Public, “Eéias <br/>My Commission Expires ' g 7‘ /; </p>
</div>
<div style="position: absolute; margin-left: 330px; margin-top: 2145px;">
<p class="styleSans52.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Roam MIcHELLE MEYER Notary Pub1ic, State of Texas <br/>My Commission Expires June 27. 2015 <br/> </p>
</div>
<div style="position: absolute; margin-left: 1485px; margin-top: 137px;">
<p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">5 Greenway Plaza, Suite 110, Houston, Texas 77046-0521 <br/>P.0. Box 27570. Houston, Texas 77227-7570 Phone 713.215.7000 <br/>www.0xy.com </p>
</div>
</body>
</html>
| {
"content_hash": "970da4659fdc3b073f32a5ae307933cd",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 647,
"avg_line_length": 71.34545454545454,
"alnum_prop": 0.7041284403669725,
"repo_name": "datamade/elpc_bakken",
"id": "67e408ed024f5aa32f6c989fd467a4241c5f3d33",
"size": "3940",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ocr_extracted/W28730_text/page4.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "17512999"
},
{
"name": "HTML",
"bytes": "421900941"
},
{
"name": "Makefile",
"bytes": "991"
},
{
"name": "Python",
"bytes": "7186"
}
],
"symlink_target": ""
} |
.note-editor {
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
}
.note-editor article,
.note-editor aside,
.note-editor details,
.note-editor figcaption,
.note-editor figure,
.note-editor footer,
.note-editor header,
.note-editor hgroup,
.note-editor main,
.note-editor nav,
.note-editor section,
.note-editor summary {
display: block;
}
.note-editor audio,
.note-editor canvas,
.note-editor video {
display: inline-block;
}
.note-editor audio:not([controls]) {
display: none;
height: 0;
}
.note-editor [hidden],
.note-editor template {
display: none;
}
.note-editor html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
.note-editor body {
margin: 0;
}
.note-editor a {
background: transparent;
}
.note-editor a:focus {
outline: thin dotted;
}
.note-editor a:active,
.note-editor a:hover {
outline: 0;
}
.note-editor h1 {
font-size: 2em;
margin: 0.67em 0;
}
.note-editor abbr[title] {
border-bottom: 1px dotted;
}
.note-editor b,
.note-editor strong {
font-weight: bold;
}
.note-editor dfn {
font-style: italic;
}
.note-editor hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.note-editor mark {
background: #ff0;
color: #000;
}
.note-editor code,
.note-editor kbd,
.note-editor pre,
.note-editor samp {
font-family: monospace, serif;
font-size: 1em;
}
.note-editor pre {
white-space: pre-wrap;
}
.note-editor q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
.note-editor small {
font-size: 80%;
}
.note-editor sub,
.note-editor sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
.note-editor sup {
top: -0.5em;
}
.note-editor sub {
bottom: -0.25em;
}
.note-editor img {
border: 0;
}
.note-editor svg:not(:root) {
overflow: hidden;
}
.note-editor figure {
margin: 0;
}
.note-editor fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
.note-editor legend {
border: 0;
padding: 0;
}
.note-editor button,
.note-editor input,
.note-editor select,
.note-editor textarea {
font-family: inherit;
font-size: 100%;
margin: 0;
}
.note-editor button,
.note-editor input {
line-height: normal;
}
.note-editor button,
.note-editor select {
text-transform: none;
}
.note-editor button,
.note-editor html input[type="button"],
.note-editor input[type="reset"],
.note-editor input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
.note-editor button[disabled],
.note-editor html input[disabled] {
cursor: default;
}
.note-editor input[type="checkbox"],
.note-editor input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
.note-editor input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
.note-editor input[type="search"]::-webkit-search-cancel-button,
.note-editor input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
.note-editor button::-moz-focus-inner,
.note-editor input::-moz-focus-inner {
border: 0;
padding: 0;
}
.note-editor textarea {
overflow: auto;
vertical-align: top;
}
.note-editor table {
border-collapse: collapse;
border-spacing: 0;
}
@media print {
.note-editor * {
text-shadow: none !important;
color: #000 !important;
background: transparent !important;
box-shadow: none !important;
}
.note-editor a,
.note-editor a:visited {
text-decoration: underline;
}
.note-editor a[href]:after {
content: " (" attr(href) ")";
}
.note-editor abbr[title]:after {
content: " (" attr(title) ")";
}
.note-editor .ir a:after,
.note-editor a[href^="javascript:"]:after,
.note-editor a[href^="#"]:after {
content: "";
}
.note-editor pre,
.note-editor blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
.note-editor thead {
display: table-header-group;
}
.note-editor tr,
.note-editor img {
page-break-inside: avoid;
}
.note-editor img {
max-width: 100% !important;
}
@page {
margin: 2cm .5cm;
}
.note-editor p,
.note-editor h2,
.note-editor h3 {
orphans: 3;
widows: 3;
}
.note-editor h2,
.note-editor h3 {
page-break-after: avoid;
}
.note-editor .navbar {
display: none;
}
.note-editor .table td,
.note-editor .table th {
background-color: #fff !important;
}
.note-editor .btn > .caret,
.note-editor .dropup > .btn > .caret {
border-top-color: #000 !important;
}
.note-editor .label {
border: 1px solid #000;
}
.note-editor .table {
border-collapse: collapse !important;
}
.note-editor .table-bordered th,
.note-editor .table-bordered td {
border: 1px solid #ddd !important;
}
}
.note-editor *,
.note-editor *:before,
.note-editor *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.note-editor html {
font-size: 62.5%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.note-editor body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
background-color: #ffffff;
}
.note-editor input,
.note-editor button,
.note-editor select,
.note-editor textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
.note-editor a {
color: #428bca;
text-decoration: none;
}
.note-editor a:hover,
.note-editor a:focus {
color: #2a6496;
text-decoration: underline;
}
.note-editor a:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.note-editor img {
vertical-align: middle;
}
.note-editor .img-responsive {
display: block;
max-width: 100%;
height: auto;
}
.note-editor .img-rounded {
border-radius: 6px;
}
.note-editor .img-thumbnail {
padding: 4px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
}
.note-editor .img-circle {
border-radius: 50%;
}
.note-editor hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee;
}
.note-editor .sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.note-editor p {
margin: 0 0 10px;
}
.note-editor .lead {
margin-bottom: 20px;
font-size: 16px;
font-weight: 200;
line-height: 1.4;
}
@media (min-width: 768px) {
.note-editor .lead {
font-size: 21px;
}
}
.note-editor small,
.note-editor .small {
font-size: 85%;
}
.note-editor cite {
font-style: normal;
}
.note-editor .text-muted {
color: #999999;
}
.note-editor .text-primary {
color: #428bca;
}
.note-editor .text-primary:hover {
color: #3071a9;
}
.note-editor .text-warning {
color: #c09853;
}
.note-editor .text-warning:hover {
color: #a47e3c;
}
.note-editor .text-danger {
color: #b94a48;
}
.note-editor .text-danger:hover {
color: #953b39;
}
.note-editor .text-success {
color: #468847;
}
.note-editor .text-success:hover {
color: #356635;
}
.note-editor .text-info {
color: #3a87ad;
}
.note-editor .text-info:hover {
color: #2d6987;
}
.note-editor .text-left {
text-align: left;
}
.note-editor .text-right {
text-align: right;
}
.note-editor .text-center {
text-align: center;
}
.note-editor h1,
.note-editor h2,
.note-editor h3,
.note-editor h4,
.note-editor h5,
.note-editor h6,
.note-editor .h1,
.note-editor .h2,
.note-editor .h3,
.note-editor .h4,
.note-editor .h5,
.note-editor .h6 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
.note-editor h1 small,
.note-editor h2 small,
.note-editor h3 small,
.note-editor h4 small,
.note-editor h5 small,
.note-editor h6 small,
.note-editor .h1 small,
.note-editor .h2 small,
.note-editor .h3 small,
.note-editor .h4 small,
.note-editor .h5 small,
.note-editor .h6 small,
.note-editor h1 .small,
.note-editor h2 .small,
.note-editor h3 .small,
.note-editor h4 .small,
.note-editor h5 .small,
.note-editor h6 .small,
.note-editor .h1 .small,
.note-editor .h2 .small,
.note-editor .h3 .small,
.note-editor .h4 .small,
.note-editor .h5 .small,
.note-editor .h6 .small {
font-weight: normal;
line-height: 1;
color: #999999;
}
.note-editor h1,
.note-editor h2,
.note-editor h3 {
margin-top: 20px;
margin-bottom: 10px;
}
.note-editor h1 small,
.note-editor h2 small,
.note-editor h3 small,
.note-editor h1 .small,
.note-editor h2 .small,
.note-editor h3 .small {
font-size: 65%;
}
.note-editor h4,
.note-editor h5,
.note-editor h6 {
margin-top: 10px;
margin-bottom: 10px;
}
.note-editor h4 small,
.note-editor h5 small,
.note-editor h6 small,
.note-editor h4 .small,
.note-editor h5 .small,
.note-editor h6 .small {
font-size: 75%;
}
.note-editor h1,
.note-editor .h1 {
font-size: 36px;
}
.note-editor h2,
.note-editor .h2 {
font-size: 30px;
}
.note-editor h3,
.note-editor .h3 {
font-size: 24px;
}
.note-editor h4,
.note-editor .h4 {
font-size: 18px;
}
.note-editor h5,
.note-editor .h5 {
font-size: 14px;
}
.note-editor h6,
.note-editor .h6 {
font-size: 12px;
}
.note-editor .page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eeeeee;
}
.note-editor ul,
.note-editor ol {
margin-top: 0;
margin-bottom: 10px;
}
.note-editor ul ul,
.note-editor ol ul,
.note-editor ul ol,
.note-editor ol ol {
margin-bottom: 0;
}
.note-editor .list-unstyled {
padding-left: 0;
list-style: none;
}
.note-editor .list-inline {
padding-left: 0;
list-style: none;
}
.note-editor .list-inline > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
.note-editor dl {
margin-bottom: 20px;
}
.note-editor dt,
.note-editor dd {
line-height: 1.428571429;
}
.note-editor dt {
font-weight: bold;
}
.note-editor dd {
margin-left: 0;
}
@media (min-width: 768px) {
.note-editor .dl-horizontal dt {
float: left;
width: 160px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.note-editor .dl-horizontal dd {
margin-left: 180px;
}
.note-editor .dl-horizontal dd:before,
.note-editor .dl-horizontal dd:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .dl-horizontal dd:after {
clear: both;
}
.note-editor .dl-horizontal dd:before,
.note-editor .dl-horizontal dd:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .dl-horizontal dd:after {
clear: both;
}
}
.note-editor abbr[title],
.note-editor abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #999999;
}
.note-editor abbr.initialism {
font-size: 90%;
text-transform: uppercase;
}
.note-editor blockquote {
padding: 10px 20px;
margin: 0 0 20px;
border-left: 5px solid #eeeeee;
}
.note-editor blockquote p {
font-size: 17.5px;
font-weight: 300;
line-height: 1.25;
}
.note-editor blockquote p:last-child {
margin-bottom: 0;
}
.note-editor blockquote small {
display: block;
line-height: 1.428571429;
color: #999999;
}
.note-editor blockquote small:before {
content: '\2014 \00A0';
}
.note-editor blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
}
.note-editor blockquote.pull-right p,
.note-editor blockquote.pull-right small,
.note-editor blockquote.pull-right .small {
text-align: right;
}
.note-editor blockquote.pull-right small:before,
.note-editor blockquote.pull-right .small:before {
content: '';
}
.note-editor blockquote.pull-right small:after,
.note-editor blockquote.pull-right .small:after {
content: '\00A0 \2014';
}
.note-editor blockquote:before,
.note-editor blockquote:after {
content: "";
}
.note-editor address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.428571429;
}
.note-editor code,
.note-editor kdb,
.note-editor pre,
.note-editor samp {
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
}
.note-editor code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
white-space: nowrap;
border-radius: 4px;
}
.note-editor pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.428571429;
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
border: 1px solid #cccccc;
border-radius: 4px;
}
.note-editor pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
.note-editor .pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
.note-editor .container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.note-editor .container:before,
.note-editor .container:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .container:after {
clear: both;
}
.note-editor .container:before,
.note-editor .container:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .container:after {
clear: both;
}
.note-editor .row {
margin-left: -15px;
margin-right: -15px;
}
.note-editor .row:before,
.note-editor .row:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .row:after {
clear: both;
}
.note-editor .row:before,
.note-editor .row:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .row:after {
clear: both;
}
.note-editor .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.note-editor .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11 {
float: left;
}
.note-editor .col-xs-12 {
width: 100%;
}
.note-editor .col-xs-11 {
width: 91.66666666666666%;
}
.note-editor .col-xs-10 {
width: 83.33333333333334%;
}
.note-editor .col-xs-9 {
width: 75%;
}
.note-editor .col-xs-8 {
width: 66.66666666666666%;
}
.note-editor .col-xs-7 {
width: 58.333333333333336%;
}
.note-editor .col-xs-6 {
width: 50%;
}
.note-editor .col-xs-5 {
width: 41.66666666666667%;
}
.note-editor .col-xs-4 {
width: 33.33333333333333%;
}
.note-editor .col-xs-3 {
width: 25%;
}
.note-editor .col-xs-2 {
width: 16.666666666666664%;
}
.note-editor .col-xs-1 {
width: 8.333333333333332%;
}
.note-editor .col-xs-pull-12 {
right: 100%;
}
.note-editor .col-xs-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-xs-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-xs-pull-9 {
right: 75%;
}
.note-editor .col-xs-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-xs-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-xs-pull-6 {
right: 50%;
}
.note-editor .col-xs-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-xs-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-xs-pull-3 {
right: 25%;
}
.note-editor .col-xs-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-xs-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-xs-push-12 {
left: 100%;
}
.note-editor .col-xs-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-xs-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-xs-push-9 {
left: 75%;
}
.note-editor .col-xs-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-xs-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-xs-push-6 {
left: 50%;
}
.note-editor .col-xs-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-xs-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-xs-push-3 {
left: 25%;
}
.note-editor .col-xs-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-xs-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-xs-offset-12 {
margin-left: 100%;
}
.note-editor .col-xs-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-xs-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-xs-offset-9 {
margin-left: 75%;
}
.note-editor .col-xs-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-xs-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-xs-offset-6 {
margin-left: 50%;
}
.note-editor .col-xs-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-xs-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-xs-offset-3 {
margin-left: 25%;
}
.note-editor .col-xs-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-xs-offset-1 {
margin-left: 8.333333333333332%;
}
@media (min-width: 768px) {
.note-editor .container {
width: 750px;
}
.note-editor .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11 {
float: left;
}
.note-editor .col-sm-12 {
width: 100%;
}
.note-editor .col-sm-11 {
width: 91.66666666666666%;
}
.note-editor .col-sm-10 {
width: 83.33333333333334%;
}
.note-editor .col-sm-9 {
width: 75%;
}
.note-editor .col-sm-8 {
width: 66.66666666666666%;
}
.note-editor .col-sm-7 {
width: 58.333333333333336%;
}
.note-editor .col-sm-6 {
width: 50%;
}
.note-editor .col-sm-5 {
width: 41.66666666666667%;
}
.note-editor .col-sm-4 {
width: 33.33333333333333%;
}
.note-editor .col-sm-3 {
width: 25%;
}
.note-editor .col-sm-2 {
width: 16.666666666666664%;
}
.note-editor .col-sm-1 {
width: 8.333333333333332%;
}
.note-editor .col-sm-pull-12 {
right: 100%;
}
.note-editor .col-sm-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-sm-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-sm-pull-9 {
right: 75%;
}
.note-editor .col-sm-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-sm-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-sm-pull-6 {
right: 50%;
}
.note-editor .col-sm-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-sm-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-sm-pull-3 {
right: 25%;
}
.note-editor .col-sm-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-sm-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-sm-push-12 {
left: 100%;
}
.note-editor .col-sm-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-sm-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-sm-push-9 {
left: 75%;
}
.note-editor .col-sm-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-sm-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-sm-push-6 {
left: 50%;
}
.note-editor .col-sm-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-sm-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-sm-push-3 {
left: 25%;
}
.note-editor .col-sm-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-sm-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-sm-offset-12 {
margin-left: 100%;
}
.note-editor .col-sm-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-sm-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-sm-offset-9 {
margin-left: 75%;
}
.note-editor .col-sm-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-sm-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-sm-offset-6 {
margin-left: 50%;
}
.note-editor .col-sm-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-sm-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-sm-offset-3 {
margin-left: 25%;
}
.note-editor .col-sm-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-sm-offset-1 {
margin-left: 8.333333333333332%;
}
}
@media (min-width: 992px) {
.note-editor .container {
width: 970px;
}
.note-editor .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11 {
float: left;
}
.note-editor .col-md-12 {
width: 100%;
}
.note-editor .col-md-11 {
width: 91.66666666666666%;
}
.note-editor .col-md-10 {
width: 83.33333333333334%;
}
.note-editor .col-md-9 {
width: 75%;
}
.note-editor .col-md-8 {
width: 66.66666666666666%;
}
.note-editor .col-md-7 {
width: 58.333333333333336%;
}
.note-editor .col-md-6 {
width: 50%;
}
.note-editor .col-md-5 {
width: 41.66666666666667%;
}
.note-editor .col-md-4 {
width: 33.33333333333333%;
}
.note-editor .col-md-3 {
width: 25%;
}
.note-editor .col-md-2 {
width: 16.666666666666664%;
}
.note-editor .col-md-1 {
width: 8.333333333333332%;
}
.note-editor .col-md-pull-12 {
right: 100%;
}
.note-editor .col-md-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-md-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-md-pull-9 {
right: 75%;
}
.note-editor .col-md-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-md-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-md-pull-6 {
right: 50%;
}
.note-editor .col-md-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-md-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-md-pull-3 {
right: 25%;
}
.note-editor .col-md-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-md-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-md-push-12 {
left: 100%;
}
.note-editor .col-md-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-md-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-md-push-9 {
left: 75%;
}
.note-editor .col-md-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-md-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-md-push-6 {
left: 50%;
}
.note-editor .col-md-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-md-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-md-push-3 {
left: 25%;
}
.note-editor .col-md-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-md-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-md-offset-12 {
margin-left: 100%;
}
.note-editor .col-md-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-md-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-md-offset-9 {
margin-left: 75%;
}
.note-editor .col-md-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-md-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-md-offset-6 {
margin-left: 50%;
}
.note-editor .col-md-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-md-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-md-offset-3 {
margin-left: 25%;
}
.note-editor .col-md-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-md-offset-1 {
margin-left: 8.333333333333332%;
}
}
@media (min-width: 1200px) {
.note-editor .container {
width: 1170px;
}
.note-editor .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11 {
float: left;
}
.note-editor .col-lg-12 {
width: 100%;
}
.note-editor .col-lg-11 {
width: 91.66666666666666%;
}
.note-editor .col-lg-10 {
width: 83.33333333333334%;
}
.note-editor .col-lg-9 {
width: 75%;
}
.note-editor .col-lg-8 {
width: 66.66666666666666%;
}
.note-editor .col-lg-7 {
width: 58.333333333333336%;
}
.note-editor .col-lg-6 {
width: 50%;
}
.note-editor .col-lg-5 {
width: 41.66666666666667%;
}
.note-editor .col-lg-4 {
width: 33.33333333333333%;
}
.note-editor .col-lg-3 {
width: 25%;
}
.note-editor .col-lg-2 {
width: 16.666666666666664%;
}
.note-editor .col-lg-1 {
width: 8.333333333333332%;
}
.note-editor .col-lg-pull-12 {
right: 100%;
}
.note-editor .col-lg-pull-11 {
right: 91.66666666666666%;
}
.note-editor .col-lg-pull-10 {
right: 83.33333333333334%;
}
.note-editor .col-lg-pull-9 {
right: 75%;
}
.note-editor .col-lg-pull-8 {
right: 66.66666666666666%;
}
.note-editor .col-lg-pull-7 {
right: 58.333333333333336%;
}
.note-editor .col-lg-pull-6 {
right: 50%;
}
.note-editor .col-lg-pull-5 {
right: 41.66666666666667%;
}
.note-editor .col-lg-pull-4 {
right: 33.33333333333333%;
}
.note-editor .col-lg-pull-3 {
right: 25%;
}
.note-editor .col-lg-pull-2 {
right: 16.666666666666664%;
}
.note-editor .col-lg-pull-1 {
right: 8.333333333333332%;
}
.note-editor .col-lg-push-12 {
left: 100%;
}
.note-editor .col-lg-push-11 {
left: 91.66666666666666%;
}
.note-editor .col-lg-push-10 {
left: 83.33333333333334%;
}
.note-editor .col-lg-push-9 {
left: 75%;
}
.note-editor .col-lg-push-8 {
left: 66.66666666666666%;
}
.note-editor .col-lg-push-7 {
left: 58.333333333333336%;
}
.note-editor .col-lg-push-6 {
left: 50%;
}
.note-editor .col-lg-push-5 {
left: 41.66666666666667%;
}
.note-editor .col-lg-push-4 {
left: 33.33333333333333%;
}
.note-editor .col-lg-push-3 {
left: 25%;
}
.note-editor .col-lg-push-2 {
left: 16.666666666666664%;
}
.note-editor .col-lg-push-1 {
left: 8.333333333333332%;
}
.note-editor .col-lg-offset-12 {
margin-left: 100%;
}
.note-editor .col-lg-offset-11 {
margin-left: 91.66666666666666%;
}
.note-editor .col-lg-offset-10 {
margin-left: 83.33333333333334%;
}
.note-editor .col-lg-offset-9 {
margin-left: 75%;
}
.note-editor .col-lg-offset-8 {
margin-left: 66.66666666666666%;
}
.note-editor .col-lg-offset-7 {
margin-left: 58.333333333333336%;
}
.note-editor .col-lg-offset-6 {
margin-left: 50%;
}
.note-editor .col-lg-offset-5 {
margin-left: 41.66666666666667%;
}
.note-editor .col-lg-offset-4 {
margin-left: 33.33333333333333%;
}
.note-editor .col-lg-offset-3 {
margin-left: 25%;
}
.note-editor .col-lg-offset-2 {
margin-left: 16.666666666666664%;
}
.note-editor .col-lg-offset-1 {
margin-left: 8.333333333333332%;
}
}
.note-editor table {
max-width: 100%;
background-color: transparent;
}
.note-editor th {
text-align: left;
}
.note-editor .table {
width: 100%;
margin-bottom: 20px;
}
.note-editor .table > thead > tr > th,
.note-editor .table > tbody > tr > th,
.note-editor .table > tfoot > tr > th,
.note-editor .table > thead > tr > td,
.note-editor .table > tbody > tr > td,
.note-editor .table > tfoot > tr > td {
padding: 8px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #dddddd;
}
.note-editor .table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #dddddd;
}
.note-editor .table > caption + thead > tr:first-child > th,
.note-editor .table > colgroup + thead > tr:first-child > th,
.note-editor .table > thead:first-child > tr:first-child > th,
.note-editor .table > caption + thead > tr:first-child > td,
.note-editor .table > colgroup + thead > tr:first-child > td,
.note-editor .table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.note-editor .table > tbody + tbody {
border-top: 2px solid #dddddd;
}
.note-editor .table .table {
background-color: #ffffff;
}
.note-editor .table-condensed > thead > tr > th,
.note-editor .table-condensed > tbody > tr > th,
.note-editor .table-condensed > tfoot > tr > th,
.note-editor .table-condensed > thead > tr > td,
.note-editor .table-condensed > tbody > tr > td,
.note-editor .table-condensed > tfoot > tr > td {
padding: 5px;
}
.note-editor .table-bordered {
border: 1px solid #dddddd;
}
.note-editor .table-bordered > thead > tr > th,
.note-editor .table-bordered > tbody > tr > th,
.note-editor .table-bordered > tfoot > tr > th,
.note-editor .table-bordered > thead > tr > td,
.note-editor .table-bordered > tbody > tr > td,
.note-editor .table-bordered > tfoot > tr > td {
border: 1px solid #dddddd;
}
.note-editor .table-bordered > thead > tr > th,
.note-editor .table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.note-editor .table-striped > tbody > tr:nth-child(odd) > td,
.note-editor .table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
.note-editor .table-hover > tbody > tr:hover > td,
.note-editor .table-hover > tbody > tr:hover > th {
background-color: #f5f5f5;
}
.note-editor table col[class*="col-"] {
float: none;
display: table-column;
}
.note-editor table td[class*="col-"],
.note-editor table th[class*="col-"] {
float: none;
display: table-cell;
}
.note-editor .table > thead > tr > td.active,
.note-editor .table > tbody > tr > td.active,
.note-editor .table > tfoot > tr > td.active,
.note-editor .table > thead > tr > th.active,
.note-editor .table > tbody > tr > th.active,
.note-editor .table > tfoot > tr > th.active,
.note-editor .table > thead > tr.active > td,
.note-editor .table > tbody > tr.active > td,
.note-editor .table > tfoot > tr.active > td,
.note-editor .table > thead > tr.active > th,
.note-editor .table > tbody > tr.active > th,
.note-editor .table > tfoot > tr.active > th {
background-color: #f5f5f5;
}
.note-editor .table > thead > tr > td.success,
.note-editor .table > tbody > tr > td.success,
.note-editor .table > tfoot > tr > td.success,
.note-editor .table > thead > tr > th.success,
.note-editor .table > tbody > tr > th.success,
.note-editor .table > tfoot > tr > th.success,
.note-editor .table > thead > tr.success > td,
.note-editor .table > tbody > tr.success > td,
.note-editor .table > tfoot > tr.success > td,
.note-editor .table > thead > tr.success > th,
.note-editor .table > tbody > tr.success > th,
.note-editor .table > tfoot > tr.success > th {
background-color: #dff0d8;
border-color: #d6e9c6;
}
.note-editor .table-hover > tbody > tr > td.success:hover,
.note-editor .table-hover > tbody > tr > th.success:hover,
.note-editor .table-hover > tbody > tr.success:hover > td,
.note-editor .table-hover > tbody > tr.success:hover > th {
background-color: #d0e9c6;
border-color: #c9e2b3;
}
.note-editor .table > thead > tr > td.danger,
.note-editor .table > tbody > tr > td.danger,
.note-editor .table > tfoot > tr > td.danger,
.note-editor .table > thead > tr > th.danger,
.note-editor .table > tbody > tr > th.danger,
.note-editor .table > tfoot > tr > th.danger,
.note-editor .table > thead > tr.danger > td,
.note-editor .table > tbody > tr.danger > td,
.note-editor .table > tfoot > tr.danger > td,
.note-editor .table > thead > tr.danger > th,
.note-editor .table > tbody > tr.danger > th,
.note-editor .table > tfoot > tr.danger > th {
background-color: #f2dede;
border-color: #ebccd1;
}
.note-editor .table-hover > tbody > tr > td.danger:hover,
.note-editor .table-hover > tbody > tr > th.danger:hover,
.note-editor .table-hover > tbody > tr.danger:hover > td,
.note-editor .table-hover > tbody > tr.danger:hover > th {
background-color: #ebcccc;
border-color: #e4b9c0;
}
.note-editor .table > thead > tr > td.warning,
.note-editor .table > tbody > tr > td.warning,
.note-editor .table > tfoot > tr > td.warning,
.note-editor .table > thead > tr > th.warning,
.note-editor .table > tbody > tr > th.warning,
.note-editor .table > tfoot > tr > th.warning,
.note-editor .table > thead > tr.warning > td,
.note-editor .table > tbody > tr.warning > td,
.note-editor .table > tfoot > tr.warning > td,
.note-editor .table > thead > tr.warning > th,
.note-editor .table > tbody > tr.warning > th,
.note-editor .table > tfoot > tr.warning > th {
background-color: #fcf8e3;
border-color: #faebcc;
}
.note-editor .table-hover > tbody > tr > td.warning:hover,
.note-editor .table-hover > tbody > tr > th.warning:hover,
.note-editor .table-hover > tbody > tr.warning:hover > td,
.note-editor .table-hover > tbody > tr.warning:hover > th {
background-color: #faf2cc;
border-color: #f7e1b5;
}
@media (max-width: 767px) {
.note-editor .table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
overflow-x: scroll;
-ms-overflow-style: -ms-autohiding-scrollbar;
border: 1px solid #dddddd;
-webkit-overflow-scrolling: touch;
}
.note-editor .table-responsive > .table {
margin-bottom: 0;
}
.note-editor .table-responsive > .table > thead > tr > th,
.note-editor .table-responsive > .table > tbody > tr > th,
.note-editor .table-responsive > .table > tfoot > tr > th,
.note-editor .table-responsive > .table > thead > tr > td,
.note-editor .table-responsive > .table > tbody > tr > td,
.note-editor .table-responsive > .table > tfoot > tr > td {
white-space: nowrap;
}
.note-editor .table-responsive > .table-bordered {
border: 0;
}
.note-editor .table-responsive > .table-bordered > thead > tr > th:first-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > th:first-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.note-editor .table-responsive > .table-bordered > thead > tr > td:first-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > td:first-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.note-editor .table-responsive > .table-bordered > thead > tr > th:last-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > th:last-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.note-editor .table-responsive > .table-bordered > thead > tr > td:last-child,
.note-editor .table-responsive > .table-bordered > tbody > tr > td:last-child,
.note-editor .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.note-editor .table-responsive > .table-bordered > tbody > tr:last-child > th,
.note-editor .table-responsive > .table-bordered > tfoot > tr:last-child > th,
.note-editor .table-responsive > .table-bordered > tbody > tr:last-child > td,
.note-editor .table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
}
.note-editor fieldset {
padding: 0;
margin: 0;
border: 0;
}
.note-editor legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333333;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
.note-editor label {
display: inline-block;
margin-bottom: 5px;
font-weight: bold;
}
.note-editor input[type="search"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.note-editor input[type="radio"],
.note-editor input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
/* IE8-9 */
line-height: normal;
}
.note-editor input[type="file"] {
display: block;
}
.note-editor select[multiple],
.note-editor select[size] {
height: auto;
}
.note-editor select optgroup {
font-size: inherit;
font-style: inherit;
font-family: inherit;
}
.note-editor input[type="file"]:focus,
.note-editor input[type="radio"]:focus,
.note-editor input[type="checkbox"]:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.note-editor input[type="number"]::-webkit-outer-spin-button,
.note-editor input[type="number"]::-webkit-inner-spin-button {
height: auto;
}
.note-editor output {
display: block;
padding-top: 7px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
}
.note-editor .form-control:-moz-placeholder {
color: #999999;
}
.note-editor .form-control::-moz-placeholder {
color: #999999;
}
.note-editor .form-control:-ms-input-placeholder {
color: #999999;
}
.note-editor .form-control::-webkit-input-placeholder {
color: #999999;
}
.note-editor .form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.note-editor .form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.note-editor .form-control[disabled],
.note-editor .form-control[readonly],
fieldset[disabled] .note-editor .form-control {
cursor: not-allowed;
background-color: #eeeeee;
}
textarea.note-editor .form-control {
height: auto;
}
.note-editor .form-group {
margin-bottom: 15px;
}
.note-editor .radio,
.note-editor .checkbox {
display: block;
min-height: 20px;
margin-top: 10px;
margin-bottom: 10px;
padding-left: 20px;
vertical-align: middle;
}
.note-editor .radio label,
.note-editor .checkbox label {
display: inline;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
.note-editor .radio input[type="radio"],
.note-editor .radio-inline input[type="radio"],
.note-editor .checkbox input[type="checkbox"],
.note-editor .checkbox-inline input[type="checkbox"] {
float: left;
margin-left: -20px;
}
.note-editor .radio + .radio,
.note-editor .checkbox + .checkbox {
margin-top: -5px;
}
.note-editor .radio-inline,
.note-editor .checkbox-inline {
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
vertical-align: middle;
font-weight: normal;
cursor: pointer;
}
.note-editor .radio-inline + .radio-inline,
.note-editor .checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
.note-editor input[type="radio"][disabled],
.note-editor input[type="checkbox"][disabled],
.note-editor .radio[disabled],
.note-editor .radio-inline[disabled],
.note-editor .checkbox[disabled],
.note-editor .checkbox-inline[disabled],
fieldset[disabled] .note-editor input[type="radio"],
fieldset[disabled] .note-editor input[type="checkbox"],
fieldset[disabled] .note-editor .radio,
fieldset[disabled] .note-editor .radio-inline,
fieldset[disabled] .note-editor .checkbox,
fieldset[disabled] .note-editor .checkbox-inline {
cursor: not-allowed;
}
.note-editor .input-sm {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.note-editor .input-sm {
height: 30px;
line-height: 30px;
}
textarea.note-editor .input-sm {
height: auto;
}
.note-editor .input-lg {
height: 45px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.note-editor .input-lg {
height: 45px;
line-height: 45px;
}
textarea.note-editor .input-lg {
height: auto;
}
.note-editor .has-warning .help-block,
.note-editor .has-warning .control-label {
color: #c09853;
}
.note-editor .has-warning .form-control {
border-color: #c09853;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.note-editor .has-warning .form-control:focus {
border-color: #a47e3c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}
.note-editor .has-warning .input-group-addon {
color: #c09853;
border-color: #c09853;
background-color: #fcf8e3;
}
.note-editor .has-error .help-block,
.note-editor .has-error .control-label {
color: #b94a48;
}
.note-editor .has-error .form-control {
border-color: #b94a48;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.note-editor .has-error .form-control:focus {
border-color: #953b39;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
.note-editor .has-error .input-group-addon {
color: #b94a48;
border-color: #b94a48;
background-color: #f2dede;
}
.note-editor .has-success .help-block,
.note-editor .has-success .control-label {
color: #468847;
}
.note-editor .has-success .form-control {
border-color: #468847;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.note-editor .has-success .form-control:focus {
border-color: #356635;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}
.note-editor .has-success .input-group-addon {
color: #468847;
border-color: #468847;
background-color: #dff0d8;
}
.note-editor .form-control-static {
margin-bottom: 0;
}
.note-editor .help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373;
}
@media (min-width: 768px) {
.note-editor .form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.note-editor .form-inline .form-control {
display: inline-block;
}
.note-editor .form-inline .radio,
.note-editor .form-inline .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.note-editor .form-inline .radio input[type="radio"],
.note-editor .form-inline .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
.note-editor .form-horizontal .control-label,
.note-editor .form-horizontal .radio,
.note-editor .form-horizontal .checkbox,
.note-editor .form-horizontal .radio-inline,
.note-editor .form-horizontal .checkbox-inline {
margin-top: 0;
margin-bottom: 0;
padding-top: 7px;
}
.note-editor .form-horizontal .form-group {
margin-left: -15px;
margin-right: -15px;
}
.note-editor .form-horizontal .form-group:before,
.note-editor .form-horizontal .form-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .form-horizontal .form-group:after {
clear: both;
}
.note-editor .form-horizontal .form-group:before,
.note-editor .form-horizontal .form-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .form-horizontal .form-group:after {
clear: both;
}
.note-editor .form-horizontal .form-control-static {
padding-top: 7px;
}
@media (min-width: 768px) {
.note-editor .form-horizontal .control-label {
text-align: right;
}
}
.note-editor .btn {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.note-editor .btn:focus {
outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.note-editor .btn:hover,
.note-editor .btn:focus {
color: #333333;
text-decoration: none;
}
.note-editor .btn:active,
.note-editor .btn.active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.note-editor .btn.disabled,
.note-editor .btn[disabled],
fieldset[disabled] .note-editor .btn {
cursor: not-allowed;
pointer-events: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
.note-editor .btn-default {
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
}
.note-editor .btn-default:hover,
.note-editor .btn-default:focus,
.note-editor .btn-default:active,
.note-editor .btn-default.active,
.open .dropdown-toggle.note-editor .btn-default {
color: #333333;
background-color: #ebebeb;
border-color: #adadad;
}
.note-editor .btn-default:active,
.note-editor .btn-default.active,
.open .dropdown-toggle.note-editor .btn-default {
background-image: none;
}
.note-editor .btn-default.disabled,
.note-editor .btn-default[disabled],
fieldset[disabled] .note-editor .btn-default,
.note-editor .btn-default.disabled:hover,
.note-editor .btn-default[disabled]:hover,
fieldset[disabled] .note-editor .btn-default:hover,
.note-editor .btn-default.disabled:focus,
.note-editor .btn-default[disabled]:focus,
fieldset[disabled] .note-editor .btn-default:focus,
.note-editor .btn-default.disabled:active,
.note-editor .btn-default[disabled]:active,
fieldset[disabled] .note-editor .btn-default:active,
.note-editor .btn-default.disabled.active,
.note-editor .btn-default[disabled].active,
fieldset[disabled] .note-editor .btn-default.active {
background-color: #ffffff;
border-color: #cccccc;
}
.note-editor .btn-primary {
color: #ffffff;
background-color: #428bca;
border-color: #357ebd;
}
.note-editor .btn-primary:hover,
.note-editor .btn-primary:focus,
.note-editor .btn-primary:active,
.note-editor .btn-primary.active,
.open .dropdown-toggle.note-editor .btn-primary {
color: #ffffff;
background-color: #3276b1;
border-color: #285e8e;
}
.note-editor .btn-primary:active,
.note-editor .btn-primary.active,
.open .dropdown-toggle.note-editor .btn-primary {
background-image: none;
}
.note-editor .btn-primary.disabled,
.note-editor .btn-primary[disabled],
fieldset[disabled] .note-editor .btn-primary,
.note-editor .btn-primary.disabled:hover,
.note-editor .btn-primary[disabled]:hover,
fieldset[disabled] .note-editor .btn-primary:hover,
.note-editor .btn-primary.disabled:focus,
.note-editor .btn-primary[disabled]:focus,
fieldset[disabled] .note-editor .btn-primary:focus,
.note-editor .btn-primary.disabled:active,
.note-editor .btn-primary[disabled]:active,
fieldset[disabled] .note-editor .btn-primary:active,
.note-editor .btn-primary.disabled.active,
.note-editor .btn-primary[disabled].active,
fieldset[disabled] .note-editor .btn-primary.active {
background-color: #428bca;
border-color: #357ebd;
}
.note-editor .btn-warning {
color: #ffffff;
background-color: #f0ad4e;
border-color: #eea236;
}
.note-editor .btn-warning:hover,
.note-editor .btn-warning:focus,
.note-editor .btn-warning:active,
.note-editor .btn-warning.active,
.open .dropdown-toggle.note-editor .btn-warning {
color: #ffffff;
background-color: #ed9c28;
border-color: #d58512;
}
.note-editor .btn-warning:active,
.note-editor .btn-warning.active,
.open .dropdown-toggle.note-editor .btn-warning {
background-image: none;
}
.note-editor .btn-warning.disabled,
.note-editor .btn-warning[disabled],
fieldset[disabled] .note-editor .btn-warning,
.note-editor .btn-warning.disabled:hover,
.note-editor .btn-warning[disabled]:hover,
fieldset[disabled] .note-editor .btn-warning:hover,
.note-editor .btn-warning.disabled:focus,
.note-editor .btn-warning[disabled]:focus,
fieldset[disabled] .note-editor .btn-warning:focus,
.note-editor .btn-warning.disabled:active,
.note-editor .btn-warning[disabled]:active,
fieldset[disabled] .note-editor .btn-warning:active,
.note-editor .btn-warning.disabled.active,
.note-editor .btn-warning[disabled].active,
fieldset[disabled] .note-editor .btn-warning.active {
background-color: #f0ad4e;
border-color: #eea236;
}
.note-editor .btn-danger {
color: #ffffff;
background-color: #d9534f;
border-color: #d43f3a;
}
.note-editor .btn-danger:hover,
.note-editor .btn-danger:focus,
.note-editor .btn-danger:active,
.note-editor .btn-danger.active,
.open .dropdown-toggle.note-editor .btn-danger {
color: #ffffff;
background-color: #d2322d;
border-color: #ac2925;
}
.note-editor .btn-danger:active,
.note-editor .btn-danger.active,
.open .dropdown-toggle.note-editor .btn-danger {
background-image: none;
}
.note-editor .btn-danger.disabled,
.note-editor .btn-danger[disabled],
fieldset[disabled] .note-editor .btn-danger,
.note-editor .btn-danger.disabled:hover,
.note-editor .btn-danger[disabled]:hover,
fieldset[disabled] .note-editor .btn-danger:hover,
.note-editor .btn-danger.disabled:focus,
.note-editor .btn-danger[disabled]:focus,
fieldset[disabled] .note-editor .btn-danger:focus,
.note-editor .btn-danger.disabled:active,
.note-editor .btn-danger[disabled]:active,
fieldset[disabled] .note-editor .btn-danger:active,
.note-editor .btn-danger.disabled.active,
.note-editor .btn-danger[disabled].active,
fieldset[disabled] .note-editor .btn-danger.active {
background-color: #d9534f;
border-color: #d43f3a;
}
.note-editor .btn-success {
color: #ffffff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.note-editor .btn-success:hover,
.note-editor .btn-success:focus,
.note-editor .btn-success:active,
.note-editor .btn-success.active,
.open .dropdown-toggle.note-editor .btn-success {
color: #ffffff;
background-color: #47a447;
border-color: #398439;
}
.note-editor .btn-success:active,
.note-editor .btn-success.active,
.open .dropdown-toggle.note-editor .btn-success {
background-image: none;
}
.note-editor .btn-success.disabled,
.note-editor .btn-success[disabled],
fieldset[disabled] .note-editor .btn-success,
.note-editor .btn-success.disabled:hover,
.note-editor .btn-success[disabled]:hover,
fieldset[disabled] .note-editor .btn-success:hover,
.note-editor .btn-success.disabled:focus,
.note-editor .btn-success[disabled]:focus,
fieldset[disabled] .note-editor .btn-success:focus,
.note-editor .btn-success.disabled:active,
.note-editor .btn-success[disabled]:active,
fieldset[disabled] .note-editor .btn-success:active,
.note-editor .btn-success.disabled.active,
.note-editor .btn-success[disabled].active,
fieldset[disabled] .note-editor .btn-success.active {
background-color: #5cb85c;
border-color: #4cae4c;
}
.note-editor .btn-info {
color: #ffffff;
background-color: #5bc0de;
border-color: #46b8da;
}
.note-editor .btn-info:hover,
.note-editor .btn-info:focus,
.note-editor .btn-info:active,
.note-editor .btn-info.active,
.open .dropdown-toggle.note-editor .btn-info {
color: #ffffff;
background-color: #39b3d7;
border-color: #269abc;
}
.note-editor .btn-info:active,
.note-editor .btn-info.active,
.open .dropdown-toggle.note-editor .btn-info {
background-image: none;
}
.note-editor .btn-info.disabled,
.note-editor .btn-info[disabled],
fieldset[disabled] .note-editor .btn-info,
.note-editor .btn-info.disabled:hover,
.note-editor .btn-info[disabled]:hover,
fieldset[disabled] .note-editor .btn-info:hover,
.note-editor .btn-info.disabled:focus,
.note-editor .btn-info[disabled]:focus,
fieldset[disabled] .note-editor .btn-info:focus,
.note-editor .btn-info.disabled:active,
.note-editor .btn-info[disabled]:active,
fieldset[disabled] .note-editor .btn-info:active,
.note-editor .btn-info.disabled.active,
.note-editor .btn-info[disabled].active,
fieldset[disabled] .note-editor .btn-info.active {
background-color: #5bc0de;
border-color: #46b8da;
}
.note-editor .btn-link {
color: #428bca;
font-weight: normal;
cursor: pointer;
border-radius: 0;
}
.note-editor .btn-link,
.note-editor .btn-link:active,
.note-editor .btn-link[disabled],
fieldset[disabled] .note-editor .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.note-editor .btn-link,
.note-editor .btn-link:hover,
.note-editor .btn-link:focus,
.note-editor .btn-link:active {
border-color: transparent;
}
.note-editor .btn-link:hover,
.note-editor .btn-link:focus {
color: #2a6496;
text-decoration: underline;
background-color: transparent;
}
.note-editor .btn-link[disabled]:hover,
fieldset[disabled] .note-editor .btn-link:hover,
.note-editor .btn-link[disabled]:focus,
fieldset[disabled] .note-editor .btn-link:focus {
color: #999999;
text-decoration: none;
}
.note-editor .btn-lg {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.note-editor .btn-sm,
.note-editor .btn-xs {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.note-editor .btn-xs {
padding: 1px 5px;
}
.note-editor .btn-block {
display: block;
width: 100%;
padding-left: 0;
padding-right: 0;
}
.note-editor .btn-block + .btn-block {
margin-top: 5px;
}
.note-editor input[type="submit"].btn-block,
.note-editor input[type="reset"].btn-block,
.note-editor input[type="button"].btn-block {
width: 100%;
}
.note-editor .fade {
opacity: 0;
-webkit-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.note-editor .fade.in {
opacity: 1;
}
.note-editor .collapse {
display: none;
}
.note-editor .collapse.in {
display: block;
}
.note-editor .collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.35s ease;
transition: height 0.35s ease;
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('http://themes.startbootstrap.com/flex-admin-v1.2/css/plugins/fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg') format('svg');
}
.note-editor .glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.note-editor .glyphicon:empty {
width: 1em;
}
.note-editor .glyphicon-asterisk:before {
content: "\2a";
}
.note-editor .glyphicon-plus:before {
content: "\2b";
}
.note-editor .glyphicon-euro:before {
content: "\20ac";
}
.note-editor .glyphicon-minus:before {
content: "\2212";
}
.note-editor .glyphicon-cloud:before {
content: "\2601";
}
.note-editor .glyphicon-envelope:before {
content: "\2709";
}
.note-editor .glyphicon-pencil:before {
content: "\270f";
}
.note-editor .glyphicon-glass:before {
content: "\e001";
}
.note-editor .glyphicon-music:before {
content: "\e002";
}
.note-editor .glyphicon-search:before {
content: "\e003";
}
.note-editor .glyphicon-heart:before {
content: "\e005";
}
.note-editor .glyphicon-star:before {
content: "\e006";
}
.note-editor .glyphicon-star-empty:before {
content: "\e007";
}
.note-editor .glyphicon-user:before {
content: "\e008";
}
.note-editor .glyphicon-film:before {
content: "\e009";
}
.note-editor .glyphicon-th-large:before {
content: "\e010";
}
.note-editor .glyphicon-th:before {
content: "\e011";
}
.note-editor .glyphicon-th-list:before {
content: "\e012";
}
.note-editor .glyphicon-ok:before {
content: "\e013";
}
.note-editor .glyphicon-remove:before {
content: "\e014";
}
.note-editor .glyphicon-zoom-in:before {
content: "\e015";
}
.note-editor .glyphicon-zoom-out:before {
content: "\e016";
}
.note-editor .glyphicon-off:before {
content: "\e017";
}
.note-editor .glyphicon-signal:before {
content: "\e018";
}
.note-editor .glyphicon-cog:before {
content: "\e019";
}
.note-editor .glyphicon-trash:before {
content: "\e020";
}
.note-editor .glyphicon-home:before {
content: "\e021";
}
.note-editor .glyphicon-file:before {
content: "\e022";
}
.note-editor .glyphicon-time:before {
content: "\e023";
}
.note-editor .glyphicon-road:before {
content: "\e024";
}
.note-editor .glyphicon-download-alt:before {
content: "\e025";
}
.note-editor .glyphicon-download:before {
content: "\e026";
}
.note-editor .glyphicon-upload:before {
content: "\e027";
}
.note-editor .glyphicon-inbox:before {
content: "\e028";
}
.note-editor .glyphicon-play-circle:before {
content: "\e029";
}
.note-editor .glyphicon-repeat:before {
content: "\e030";
}
.note-editor .glyphicon-refresh:before {
content: "\e031";
}
.note-editor .glyphicon-list-alt:before {
content: "\e032";
}
.note-editor .glyphicon-lock:before {
content: "\e033";
}
.note-editor .glyphicon-flag:before {
content: "\e034";
}
.note-editor .glyphicon-headphones:before {
content: "\e035";
}
.note-editor .glyphicon-volume-off:before {
content: "\e036";
}
.note-editor .glyphicon-volume-down:before {
content: "\e037";
}
.note-editor .glyphicon-volume-up:before {
content: "\e038";
}
.note-editor .glyphicon-qrcode:before {
content: "\e039";
}
.note-editor .glyphicon-barcode:before {
content: "\e040";
}
.note-editor .glyphicon-tag:before {
content: "\e041";
}
.note-editor .glyphicon-tags:before {
content: "\e042";
}
.note-editor .glyphicon-book:before {
content: "\e043";
}
.note-editor .glyphicon-bookmark:before {
content: "\e044";
}
.note-editor .glyphicon-print:before {
content: "\e045";
}
.note-editor .glyphicon-camera:before {
content: "\e046";
}
.note-editor .glyphicon-font:before {
content: "\e047";
}
.note-editor .glyphicon-bold:before {
content: "\e048";
}
.note-editor .glyphicon-italic:before {
content: "\e049";
}
.note-editor .glyphicon-text-height:before {
content: "\e050";
}
.note-editor .glyphicon-text-width:before {
content: "\e051";
}
.note-editor .glyphicon-align-left:before {
content: "\e052";
}
.note-editor .glyphicon-align-center:before {
content: "\e053";
}
.note-editor .glyphicon-align-right:before {
content: "\e054";
}
.note-editor .glyphicon-align-justify:before {
content: "\e055";
}
.note-editor .glyphicon-list:before {
content: "\e056";
}
.note-editor .glyphicon-indent-left:before {
content: "\e057";
}
.note-editor .glyphicon-indent-right:before {
content: "\e058";
}
.note-editor .glyphicon-facetime-video:before {
content: "\e059";
}
.note-editor .glyphicon-picture:before {
content: "\e060";
}
.note-editor .glyphicon-map-marker:before {
content: "\e062";
}
.note-editor .glyphicon-adjust:before {
content: "\e063";
}
.note-editor .glyphicon-tint:before {
content: "\e064";
}
.note-editor .glyphicon-edit:before {
content: "\e065";
}
.note-editor .glyphicon-share:before {
content: "\e066";
}
.note-editor .glyphicon-check:before {
content: "\e067";
}
.note-editor .glyphicon-move:before {
content: "\e068";
}
.note-editor .glyphicon-step-backward:before {
content: "\e069";
}
.note-editor .glyphicon-fast-backward:before {
content: "\e070";
}
.note-editor .glyphicon-backward:before {
content: "\e071";
}
.note-editor .glyphicon-play:before {
content: "\e072";
}
.note-editor .glyphicon-pause:before {
content: "\e073";
}
.note-editor .glyphicon-stop:before {
content: "\e074";
}
.note-editor .glyphicon-forward:before {
content: "\e075";
}
.note-editor .glyphicon-fast-forward:before {
content: "\e076";
}
.note-editor .glyphicon-step-forward:before {
content: "\e077";
}
.note-editor .glyphicon-eject:before {
content: "\e078";
}
.note-editor .glyphicon-chevron-left:before {
content: "\e079";
}
.note-editor .glyphicon-chevron-right:before {
content: "\e080";
}
.note-editor .glyphicon-plus-sign:before {
content: "\e081";
}
.note-editor .glyphicon-minus-sign:before {
content: "\e082";
}
.note-editor .glyphicon-remove-sign:before {
content: "\e083";
}
.note-editor .glyphicon-ok-sign:before {
content: "\e084";
}
.note-editor .glyphicon-question-sign:before {
content: "\e085";
}
.note-editor .glyphicon-info-sign:before {
content: "\e086";
}
.note-editor .glyphicon-screenshot:before {
content: "\e087";
}
.note-editor .glyphicon-remove-circle:before {
content: "\e088";
}
.note-editor .glyphicon-ok-circle:before {
content: "\e089";
}
.note-editor .glyphicon-ban-circle:before {
content: "\e090";
}
.note-editor .glyphicon-arrow-left:before {
content: "\e091";
}
.note-editor .glyphicon-arrow-right:before {
content: "\e092";
}
.note-editor .glyphicon-arrow-up:before {
content: "\e093";
}
.note-editor .glyphicon-arrow-down:before {
content: "\e094";
}
.note-editor .glyphicon-share-alt:before {
content: "\e095";
}
.note-editor .glyphicon-resize-full:before {
content: "\e096";
}
.note-editor .glyphicon-resize-small:before {
content: "\e097";
}
.note-editor .glyphicon-exclamation-sign:before {
content: "\e101";
}
.note-editor .glyphicon-gift:before {
content: "\e102";
}
.note-editor .glyphicon-leaf:before {
content: "\e103";
}
.note-editor .glyphicon-fire:before {
content: "\e104";
}
.note-editor .glyphicon-eye-open:before {
content: "\e105";
}
.note-editor .glyphicon-eye-close:before {
content: "\e106";
}
.note-editor .glyphicon-warning-sign:before {
content: "\e107";
}
.note-editor .glyphicon-plane:before {
content: "\e108";
}
.note-editor .glyphicon-calendar:before {
content: "\e109";
}
.note-editor .glyphicon-random:before {
content: "\e110";
}
.note-editor .glyphicon-comment:before {
content: "\e111";
}
.note-editor .glyphicon-magnet:before {
content: "\e112";
}
.note-editor .glyphicon-chevron-up:before {
content: "\e113";
}
.note-editor .glyphicon-chevron-down:before {
content: "\e114";
}
.note-editor .glyphicon-retweet:before {
content: "\e115";
}
.note-editor .glyphicon-shopping-cart:before {
content: "\e116";
}
.note-editor .glyphicon-folder-close:before {
content: "\e117";
}
.note-editor .glyphicon-folder-open:before {
content: "\e118";
}
.note-editor .glyphicon-resize-vertical:before {
content: "\e119";
}
.note-editor .glyphicon-resize-horizontal:before {
content: "\e120";
}
.note-editor .glyphicon-hdd:before {
content: "\e121";
}
.note-editor .glyphicon-bullhorn:before {
content: "\e122";
}
.note-editor .glyphicon-bell:before {
content: "\e123";
}
.note-editor .glyphicon-certificate:before {
content: "\e124";
}
.note-editor .glyphicon-thumbs-up:before {
content: "\e125";
}
.note-editor .glyphicon-thumbs-down:before {
content: "\e126";
}
.note-editor .glyphicon-hand-right:before {
content: "\e127";
}
.note-editor .glyphicon-hand-left:before {
content: "\e128";
}
.note-editor .glyphicon-hand-up:before {
content: "\e129";
}
.note-editor .glyphicon-hand-down:before {
content: "\e130";
}
.note-editor .glyphicon-circle-arrow-right:before {
content: "\e131";
}
.note-editor .glyphicon-circle-arrow-left:before {
content: "\e132";
}
.note-editor .glyphicon-circle-arrow-up:before {
content: "\e133";
}
.note-editor .glyphicon-circle-arrow-down:before {
content: "\e134";
}
.note-editor .glyphicon-globe:before {
content: "\e135";
}
.note-editor .glyphicon-wrench:before {
content: "\e136";
}
.note-editor .glyphicon-tasks:before {
content: "\e137";
}
.note-editor .glyphicon-filter:before {
content: "\e138";
}
.note-editor .glyphicon-briefcase:before {
content: "\e139";
}
.note-editor .glyphicon-fullscreen:before {
content: "\e140";
}
.note-editor .glyphicon-dashboard:before {
content: "\e141";
}
.note-editor .glyphicon-paperclip:before {
content: "\e142";
}
.note-editor .glyphicon-heart-empty:before {
content: "\e143";
}
.note-editor .glyphicon-link:before {
content: "\e144";
}
.note-editor .glyphicon-phone:before {
content: "\e145";
}
.note-editor .glyphicon-pushpin:before {
content: "\e146";
}
.note-editor .glyphicon-usd:before {
content: "\e148";
}
.note-editor .glyphicon-gbp:before {
content: "\e149";
}
.note-editor .glyphicon-sort:before {
content: "\e150";
}
.note-editor .glyphicon-sort-by-alphabet:before {
content: "\e151";
}
.note-editor .glyphicon-sort-by-alphabet-alt:before {
content: "\e152";
}
.note-editor .glyphicon-sort-by-order:before {
content: "\e153";
}
.note-editor .glyphicon-sort-by-order-alt:before {
content: "\e154";
}
.note-editor .glyphicon-sort-by-attributes:before {
content: "\e155";
}
.note-editor .glyphicon-sort-by-attributes-alt:before {
content: "\e156";
}
.note-editor .glyphicon-unchecked:before {
content: "\e157";
}
.note-editor .glyphicon-expand:before {
content: "\e158";
}
.note-editor .glyphicon-collapse-down:before {
content: "\e159";
}
.note-editor .glyphicon-collapse-up:before {
content: "\e160";
}
.note-editor .glyphicon-log-in:before {
content: "\e161";
}
.note-editor .glyphicon-flash:before {
content: "\e162";
}
.note-editor .glyphicon-log-out:before {
content: "\e163";
}
.note-editor .glyphicon-new-window:before {
content: "\e164";
}
.note-editor .glyphicon-record:before {
content: "\e165";
}
.note-editor .glyphicon-save:before {
content: "\e166";
}
.note-editor .glyphicon-open:before {
content: "\e167";
}
.note-editor .glyphicon-saved:before {
content: "\e168";
}
.note-editor .glyphicon-import:before {
content: "\e169";
}
.note-editor .glyphicon-export:before {
content: "\e170";
}
.note-editor .glyphicon-send:before {
content: "\e171";
}
.note-editor .glyphicon-floppy-disk:before {
content: "\e172";
}
.note-editor .glyphicon-floppy-saved:before {
content: "\e173";
}
.note-editor .glyphicon-floppy-remove:before {
content: "\e174";
}
.note-editor .glyphicon-floppy-save:before {
content: "\e175";
}
.note-editor .glyphicon-floppy-open:before {
content: "\e176";
}
.note-editor .glyphicon-credit-card:before {
content: "\e177";
}
.note-editor .glyphicon-transfer:before {
content: "\e178";
}
.note-editor .glyphicon-cutlery:before {
content: "\e179";
}
.note-editor .glyphicon-header:before {
content: "\e180";
}
.note-editor .glyphicon-compressed:before {
content: "\e181";
}
.note-editor .glyphicon-earphone:before {
content: "\e182";
}
.note-editor .glyphicon-phone-alt:before {
content: "\e183";
}
.note-editor .glyphicon-tower:before {
content: "\e184";
}
.note-editor .glyphicon-stats:before {
content: "\e185";
}
.note-editor .glyphicon-sd-video:before {
content: "\e186";
}
.note-editor .glyphicon-hd-video:before {
content: "\e187";
}
.note-editor .glyphicon-subtitles:before {
content: "\e188";
}
.note-editor .glyphicon-sound-stereo:before {
content: "\e189";
}
.note-editor .glyphicon-sound-dolby:before {
content: "\e190";
}
.note-editor .glyphicon-sound-5-1:before {
content: "\e191";
}
.note-editor .glyphicon-sound-6-1:before {
content: "\e192";
}
.note-editor .glyphicon-sound-7-1:before {
content: "\e193";
}
.note-editor .glyphicon-copyright-mark:before {
content: "\e194";
}
.note-editor .glyphicon-registration-mark:before {
content: "\e195";
}
.note-editor .glyphicon-cloud-download:before {
content: "\e197";
}
.note-editor .glyphicon-cloud-upload:before {
content: "\e198";
}
.note-editor .glyphicon-tree-conifer:before {
content: "\e199";
}
.note-editor .glyphicon-tree-deciduous:before {
content: "\e200";
}
.note-editor .caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid #000000;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
border-bottom: 0 dotted;
}
.note-editor .dropdown {
position: relative;
}
.note-editor .dropdown-toggle:focus {
outline: 0;
}
.note-editor .dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 14px;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
.note-editor .dropdown-menu.pull-right {
right: 0;
left: auto;
}
.note-editor .dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.note-editor .dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #333333;
white-space: nowrap;
}
.note-editor .dropdown-menu > li > a:hover,
.note-editor .dropdown-menu > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.note-editor .dropdown-menu > .active > a,
.note-editor .dropdown-menu > .active > a:hover,
.note-editor .dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
outline: 0;
background-color: #428bca;
}
.note-editor .dropdown-menu > .disabled > a,
.note-editor .dropdown-menu > .disabled > a:hover,
.note-editor .dropdown-menu > .disabled > a:focus {
color: #999999;
}
.note-editor .dropdown-menu > .disabled > a:hover,
.note-editor .dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.note-editor .open > .dropdown-menu {
display: block;
}
.note-editor .open > a {
outline: 0;
}
.note-editor .dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.428571429;
color: #999999;
}
.note-editor .dropdown-backdrop {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 990;
}
.note-editor .pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.note-editor .dropup .caret,
.note-editor .navbar-fixed-bottom .dropdown .caret {
border-top: 0 dotted;
border-bottom: 4px solid #000000;
content: "";
}
.note-editor .dropup .dropdown-menu,
.note-editor .navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 1px;
}
@media (min-width: 768px) {
.note-editor .navbar-right .dropdown-menu {
right: 0;
left: auto;
}
}
.btn-default .note-editor .caret {
border-top-color: #333333;
}
.btn-primary .note-editor .caret,
.btn-success .note-editor .caret,
.btn-warning .note-editor .caret,
.btn-danger .note-editor .caret,
.btn-info .note-editor .caret {
border-top-color: #fff;
}
.note-editor .dropup .btn-default .caret {
border-bottom-color: #333333;
}
.note-editor .dropup .btn-primary .caret,
.note-editor .dropup .btn-success .caret,
.note-editor .dropup .btn-warning .caret,
.note-editor .dropup .btn-danger .caret,
.note-editor .dropup .btn-info .caret {
border-bottom-color: #fff;
}
.note-editor .btn-group,
.note-editor .btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.note-editor .btn-group > .btn,
.note-editor .btn-group-vertical > .btn {
position: relative;
float: left;
}
.note-editor .btn-group > .btn:hover,
.note-editor .btn-group-vertical > .btn:hover,
.note-editor .btn-group > .btn:focus,
.note-editor .btn-group-vertical > .btn:focus,
.note-editor .btn-group > .btn:active,
.note-editor .btn-group-vertical > .btn:active,
.note-editor .btn-group > .btn.active,
.note-editor .btn-group-vertical > .btn.active {
z-index: 2;
}
.note-editor .btn-group > .btn:focus,
.note-editor .btn-group-vertical > .btn:focus {
outline: none;
}
.note-editor .btn-group .btn + .btn,
.note-editor .btn-group .btn + .btn-group,
.note-editor .btn-group .btn-group + .btn,
.note-editor .btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.note-editor .btn-toolbar:before,
.note-editor .btn-toolbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-toolbar:after {
clear: both;
}
.note-editor .btn-toolbar:before,
.note-editor .btn-toolbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-toolbar:after {
clear: both;
}
.note-editor .btn-toolbar .btn-group {
float: left;
}
.note-editor .btn-toolbar > .btn + .btn,
.note-editor .btn-toolbar > .btn-group + .btn,
.note-editor .btn-toolbar > .btn + .btn-group,
.note-editor .btn-toolbar > .btn-group + .btn-group {
margin-left: 5px;
}
.note-editor .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.note-editor .btn-group > .btn:first-child {
margin-left: 0;
}
.note-editor .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.note-editor .btn-group > .btn:last-child:not(:first-child),
.note-editor .btn-group > .dropdown-toggle:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group > .btn-group {
float: left;
}
.note-editor .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.note-editor .btn-group > .btn-group:first-child > .btn:last-child,
.note-editor .btn-group > .btn-group:first-child > .dropdown-toggle {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.note-editor .btn-group > .btn-group:last-child > .btn:first-child {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group .dropdown-toggle:active,
.note-editor .btn-group.open .dropdown-toggle {
outline: 0;
}
.note-editor .btn-group-xs > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
padding: 1px 5px;
}
.note-editor .btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.note-editor .btn-group-lg > .btn {
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.note-editor .btn-group > .btn + .dropdown-toggle {
padding-left: 5px;
padding-right: 5px;
}
.note-editor .btn-group > .btn-lg + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
}
.note-editor .btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.note-editor .btn .caret {
margin-left: 0;
}
.note-editor .btn-lg .caret {
border-width: 5px 5px 0;
border-bottom-width: 0;
}
.note-editor .dropup .btn-lg .caret {
border-width: 0 5px 5px;
}
.note-editor .btn-group-vertical > .btn,
.note-editor .btn-group-vertical > .btn-group {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.note-editor .btn-group-vertical > .btn-group:before,
.note-editor .btn-group-vertical > .btn-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-group-vertical > .btn-group:after {
clear: both;
}
.note-editor .btn-group-vertical > .btn-group:before,
.note-editor .btn-group-vertical > .btn-group:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .btn-group-vertical > .btn-group:after {
clear: both;
}
.note-editor .btn-group-vertical > .btn-group > .btn {
float: none;
}
.note-editor .btn-group-vertical > .btn + .btn,
.note-editor .btn-group-vertical > .btn + .btn-group,
.note-editor .btn-group-vertical > .btn-group + .btn,
.note-editor .btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.note-editor .btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.note-editor .btn-group-vertical > .btn:first-child:not(:last-child) {
border-top-right-radius: 4px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.note-editor .btn-group-vertical > .btn:last-child:not(:first-child) {
border-bottom-left-radius: 4px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.note-editor .btn-group-vertical > .btn-group:first-child > .btn:last-child,
.note-editor .btn-group-vertical > .btn-group:first-child > .dropdown-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.note-editor .btn-group-vertical > .btn-group:last-child > .btn:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.note-editor .btn-group-justified .btn {
float: none;
display: table-cell;
width: 1%;
}
.note-editor [data-toggle="buttons"] > .btn > input[type="radio"],
.note-editor [data-toggle="buttons"] > .btn > input[type="checkbox"] {
display: none;
}
.note-editor .input-group {
position: relative;
display: table;
border-collapse: separate;
}
.note-editor .input-group.col {
float: none;
padding-left: 0;
padding-right: 0;
}
.note-editor .input-group .form-control {
width: 100%;
margin-bottom: 0;
}
.note-editor .input-group-lg > .form-control,
.note-editor .input-group-lg > .input-group-addon,
.note-editor .input-group-lg > .input-group-btn > .btn {
height: 45px;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.note-editor .input-group-lg > .form-control,
select.note-editor .input-group-lg > .input-group-addon,
select.note-editor .input-group-lg > .input-group-btn > .btn {
height: 45px;
line-height: 45px;
}
textarea.note-editor .input-group-lg > .form-control,
textarea.note-editor .input-group-lg > .input-group-addon,
textarea.note-editor .input-group-lg > .input-group-btn > .btn {
height: auto;
}
.note-editor .input-group-sm > .form-control,
.note-editor .input-group-sm > .input-group-addon,
.note-editor .input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.note-editor .input-group-sm > .form-control,
select.note-editor .input-group-sm > .input-group-addon,
select.note-editor .input-group-sm > .input-group-btn > .btn {
height: 30px;
line-height: 30px;
}
textarea.note-editor .input-group-sm > .form-control,
textarea.note-editor .input-group-sm > .input-group-addon,
textarea.note-editor .input-group-sm > .input-group-btn > .btn {
height: auto;
}
.note-editor .input-group-addon,
.note-editor .input-group-btn,
.note-editor .input-group .form-control {
display: table-cell;
}
.note-editor .input-group-addon:not(:first-child):not(:last-child),
.note-editor .input-group-btn:not(:first-child):not(:last-child),
.note-editor .input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.note-editor .input-group-addon,
.note-editor .input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle;
}
.note-editor .input-group-addon {
padding: 6px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
color: #555555;
text-align: center;
background-color: #eeeeee;
border: 1px solid #cccccc;
border-radius: 4px;
}
.note-editor .input-group-addon.input-sm {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px;
}
.note-editor .input-group-addon.input-lg {
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.note-editor .input-group-addon input[type="radio"],
.note-editor .input-group-addon input[type="checkbox"] {
margin-top: 0;
}
.note-editor .input-group .form-control:first-child,
.note-editor .input-group-addon:first-child,
.note-editor .input-group-btn:first-child > .btn,
.note-editor .input-group-btn:first-child > .dropdown-toggle,
.note-editor .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.note-editor .input-group-addon:first-child {
border-right: 0;
}
.note-editor .input-group .form-control:last-child,
.note-editor .input-group-addon:last-child,
.note-editor .input-group-btn:last-child > .btn,
.note-editor .input-group-btn:last-child > .dropdown-toggle,
.note-editor .input-group-btn:first-child > .btn:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.note-editor .input-group-addon:last-child {
border-left: 0;
}
.note-editor .input-group-btn {
position: relative;
white-space: nowrap;
}
.note-editor .input-group-btn:first-child > .btn {
margin-right: -1px;
}
.note-editor .input-group-btn:last-child > .btn {
margin-left: -1px;
}
.note-editor .input-group-btn > .btn {
position: relative;
}
.note-editor .input-group-btn > .btn + .btn {
margin-left: -4px;
}
.note-editor .input-group-btn > .btn:hover,
.note-editor .input-group-btn > .btn:active {
z-index: 2;
}
.note-editor .nav {
margin-bottom: 0;
padding-left: 0;
list-style: none;
}
.note-editor .nav:before,
.note-editor .nav:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .nav:after {
clear: both;
}
.note-editor .nav:before,
.note-editor .nav:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .nav:after {
clear: both;
}
.note-editor .nav > li {
position: relative;
display: block;
}
.note-editor .nav > li > a {
position: relative;
display: block;
padding: 10px 15px;
}
.note-editor .nav > li > a:hover,
.note-editor .nav > li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.note-editor .nav > li.disabled > a {
color: #999999;
}
.note-editor .nav > li.disabled > a:hover,
.note-editor .nav > li.disabled > a:focus {
color: #999999;
text-decoration: none;
background-color: transparent;
cursor: not-allowed;
}
.note-editor .nav .open > a,
.note-editor .nav .open > a:hover,
.note-editor .nav .open > a:focus {
background-color: #eeeeee;
border-color: #428bca;
}
.note-editor .nav .open > a .caret,
.note-editor .nav .open > a:hover .caret,
.note-editor .nav .open > a:focus .caret {
border-top-color: #2a6496;
border-bottom-color: #2a6496;
}
.note-editor .nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.note-editor .nav > li > a > img {
max-width: none;
}
.note-editor .nav-tabs {
border-bottom: 1px solid #dddddd;
}
.note-editor .nav-tabs > li {
float: left;
margin-bottom: -1px;
}
.note-editor .nav-tabs > li > a {
margin-right: 2px;
line-height: 1.428571429;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
.note-editor .nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #dddddd;
}
.note-editor .nav-tabs > li.active > a,
.note-editor .nav-tabs > li.active > a:hover,
.note-editor .nav-tabs > li.active > a:focus {
color: #555555;
background-color: #ffffff;
border: 1px solid #dddddd;
border-bottom-color: transparent;
cursor: default;
}
.note-editor .nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.note-editor .nav-tabs.nav-justified > li {
float: none;
}
.note-editor .nav-tabs.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
@media (min-width: 768px) {
.note-editor .nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.note-editor .nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
.note-editor .nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.note-editor .nav-tabs.nav-justified > .active > a,
.note-editor .nav-tabs.nav-justified > .active > a:hover,
.note-editor .nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.note-editor .nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.note-editor .nav-tabs.nav-justified > .active > a,
.note-editor .nav-tabs.nav-justified > .active > a:hover,
.note-editor .nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.note-editor .nav-pills > li {
float: left;
}
.note-editor .nav-pills > li > a {
border-radius: 4px;
}
.note-editor .nav-pills > li + li {
margin-left: 2px;
}
.note-editor .nav-pills > li.active > a,
.note-editor .nav-pills > li.active > a:hover,
.note-editor .nav-pills > li.active > a:focus {
color: #ffffff;
background-color: #428bca;
}
.note-editor .nav-pills > li.active > a .caret,
.note-editor .nav-pills > li.active > a:hover .caret,
.note-editor .nav-pills > li.active > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.note-editor .nav-stacked > li {
float: none;
}
.note-editor .nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.note-editor .nav-justified {
width: 100%;
}
.note-editor .nav-justified > li {
float: none;
}
.note-editor .nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
@media (min-width: 768px) {
.note-editor .nav-justified > li {
display: table-cell;
width: 1%;
}
.note-editor .nav-justified > li > a {
margin-bottom: 0;
}
}
.note-editor .nav-tabs-justified {
border-bottom: 0;
}
.note-editor .nav-tabs-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.note-editor .nav-tabs-justified > .active > a,
.note-editor .nav-tabs-justified > .active > a:hover,
.note-editor .nav-tabs-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.note-editor .nav-tabs-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.note-editor .nav-tabs-justified > .active > a,
.note-editor .nav-tabs-justified > .active > a:hover,
.note-editor .nav-tabs-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.note-editor .tab-content > .tab-pane {
display: none;
}
.note-editor .tab-content > .active {
display: block;
}
.note-editor .nav .caret {
border-top-color: #428bca;
border-bottom-color: #428bca;
}
.note-editor .nav a:hover .caret {
border-top-color: #2a6496;
border-bottom-color: #2a6496;
}
.note-editor .nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .navbar {
position: relative;
z-index: 1000;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
.note-editor .navbar:before,
.note-editor .navbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar:after {
clear: both;
}
.note-editor .navbar:before,
.note-editor .navbar:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar:after {
clear: both;
}
@media (min-width: 768px) {
.note-editor .navbar {
border-radius: 4px;
}
}
.note-editor .navbar-header:before,
.note-editor .navbar-header:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-header:after {
clear: both;
}
.note-editor .navbar-header:before,
.note-editor .navbar-header:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-header:after {
clear: both;
}
@media (min-width: 768px) {
.note-editor .navbar-header {
float: left;
}
}
.note-editor .navbar-collapse {
max-height: 340px;
overflow-x: visible;
padding-right: 15px;
padding-left: 15px;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch;
}
.note-editor .navbar-collapse:before,
.note-editor .navbar-collapse:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-collapse:after {
clear: both;
}
.note-editor .navbar-collapse:before,
.note-editor .navbar-collapse:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .navbar-collapse:after {
clear: both;
}
.note-editor .navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.note-editor .navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none;
}
.note-editor .navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.note-editor .navbar-collapse.in {
overflow-y: visible;
}
.note-editor .navbar-collapse .navbar-nav.navbar-left:first-child {
margin-left: -15px;
}
.note-editor .navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: -15px;
}
.note-editor .navbar-collapse .navbar-text:last-child {
margin-right: 0;
}
}
.note-editor .container > .navbar-header,
.note-editor .container > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.note-editor .container > .navbar-header,
.note-editor .container > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
}
.note-editor .navbar-static-top {
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.note-editor .navbar-static-top {
border-radius: 0;
}
}
.note-editor .navbar-fixed-top,
.note-editor .navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.note-editor .navbar-fixed-top,
.note-editor .navbar-fixed-bottom {
border-radius: 0;
}
}
.note-editor .navbar-fixed-top {
z-index: 1030;
top: 0;
}
.note-editor .navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
}
.note-editor .navbar-brand {
float: left;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
}
.note-editor .navbar-brand:hover,
.note-editor .navbar-brand:focus {
text-decoration: none;
}
@media (min-width: 768px) {
.navbar > .container .note-editor .navbar-brand {
margin-left: -15px;
}
}
.note-editor .navbar-toggle {
position: relative;
float: right;
margin-right: 15px;
padding: 9px 10px;
margin-top: 8px;
margin-bottom: 8px;
background-color: transparent;
border: 1px solid transparent;
border-radius: 4px;
}
.note-editor .navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
.note-editor .navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
.note-editor .navbar-toggle {
display: none;
}
}
.note-editor .navbar-nav {
margin: 7.5px -15px;
}
.note-editor .navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
.note-editor .navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
}
.note-editor .navbar-nav .open .dropdown-menu > li > a,
.note-editor .navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.note-editor .navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
}
.note-editor .navbar-nav .open .dropdown-menu > li > a:hover,
.note-editor .navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none;
}
}
@media (min-width: 768px) {
.note-editor .navbar-nav {
float: left;
margin: 0;
}
.note-editor .navbar-nav > li {
float: left;
}
.note-editor .navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
}
@media (min-width: 768px) {
.note-editor .navbar-left {
float: left !important;
}
.note-editor .navbar-right {
float: right !important;
}
}
.note-editor .navbar-form {
margin-left: -15px;
margin-right: -15px;
padding: 10px 15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
margin-top: 8px;
margin-bottom: 8px;
}
@media (min-width: 768px) {
.note-editor .navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.note-editor .navbar-form .form-control {
display: inline-block;
}
.note-editor .navbar-form .radio,
.note-editor .navbar-form .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.note-editor .navbar-form .radio input[type="radio"],
.note-editor .navbar-form .checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
@media (max-width: 767px) {
.note-editor .navbar-form .form-group {
margin-bottom: 5px;
}
}
@media (min-width: 768px) {
.note-editor .navbar-form {
width: auto;
border: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.note-editor .navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.note-editor .navbar-nav.pull-right > li > .dropdown-menu,
.note-editor .navbar-nav > li > .dropdown-menu.pull-right {
left: auto;
right: 0;
}
.note-editor .navbar-btn {
margin-top: 8px;
margin-bottom: 8px;
}
.note-editor .navbar-text {
float: left;
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
.note-editor .navbar-text {
margin-left: 15px;
margin-right: 15px;
}
}
.note-editor .navbar-default {
background-color: #f8f8f8;
border-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-brand {
color: #777777;
}
.note-editor .navbar-default .navbar-brand:hover,
.note-editor .navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent;
}
.note-editor .navbar-default .navbar-text {
color: #777777;
}
.note-editor .navbar-default .navbar-nav > li > a {
color: #777777;
}
.note-editor .navbar-default .navbar-nav > li > a:hover,
.note-editor .navbar-default .navbar-nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.note-editor .navbar-default .navbar-nav > .active > a,
.note-editor .navbar-default .navbar-nav > .active > a:hover,
.note-editor .navbar-default .navbar-nav > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-nav > .disabled > a,
.note-editor .navbar-default .navbar-nav > .disabled > a:hover,
.note-editor .navbar-default .navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
.note-editor .navbar-default .navbar-toggle {
border-color: #dddddd;
}
.note-editor .navbar-default .navbar-toggle:hover,
.note-editor .navbar-default .navbar-toggle:focus {
background-color: #dddddd;
}
.note-editor .navbar-default .navbar-toggle .icon-bar {
background-color: #cccccc;
}
.note-editor .navbar-default .navbar-collapse,
.note-editor .navbar-default .navbar-form {
border-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-nav > .dropdown > a:hover .caret,
.note-editor .navbar-default .navbar-nav > .dropdown > a:focus .caret {
border-top-color: #333333;
border-bottom-color: #333333;
}
.note-editor .navbar-default .navbar-nav > .open > a,
.note-editor .navbar-default .navbar-nav > .open > a:hover,
.note-editor .navbar-default .navbar-nav > .open > a:focus {
background-color: #e7e7e7;
color: #555555;
}
.note-editor .navbar-default .navbar-nav > .open > a .caret,
.note-editor .navbar-default .navbar-nav > .open > a:hover .caret,
.note-editor .navbar-default .navbar-nav > .open > a:focus .caret {
border-top-color: #555555;
border-bottom-color: #555555;
}
.note-editor .navbar-default .navbar-nav > .dropdown > a .caret {
border-top-color: #777777;
border-bottom-color: #777777;
}
@media (max-width: 767px) {
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777777;
}
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333333;
background-color: transparent;
}
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.note-editor .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
}
.note-editor .navbar-default .navbar-link {
color: #777777;
}
.note-editor .navbar-default .navbar-link:hover {
color: #333333;
}
.note-editor .navbar-inverse {
background-color: #222222;
border-color: #080808;
}
.note-editor .navbar-inverse .navbar-brand {
color: #999999;
}
.note-editor .navbar-inverse .navbar-brand:hover,
.note-editor .navbar-inverse .navbar-brand:focus {
color: #ffffff;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-text {
color: #999999;
}
.note-editor .navbar-inverse .navbar-nav > li > a {
color: #999999;
}
.note-editor .navbar-inverse .navbar-nav > li > a:hover,
.note-editor .navbar-inverse .navbar-nav > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-nav > .active > a,
.note-editor .navbar-inverse .navbar-nav > .active > a:hover,
.note-editor .navbar-inverse .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.note-editor .navbar-inverse .navbar-nav > .disabled > a,
.note-editor .navbar-inverse .navbar-nav > .disabled > a:hover,
.note-editor .navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-toggle {
border-color: #333333;
}
.note-editor .navbar-inverse .navbar-toggle:hover,
.note-editor .navbar-inverse .navbar-toggle:focus {
background-color: #333333;
}
.note-editor .navbar-inverse .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.note-editor .navbar-inverse .navbar-collapse,
.note-editor .navbar-inverse .navbar-form {
border-color: #101010;
}
.note-editor .navbar-inverse .navbar-nav > .open > a,
.note-editor .navbar-inverse .navbar-nav > .open > a:hover,
.note-editor .navbar-inverse .navbar-nav > .open > a:focus {
background-color: #080808;
color: #ffffff;
}
.note-editor .navbar-inverse .navbar-nav > .dropdown > a:hover .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
.note-editor .navbar-inverse .navbar-nav > .dropdown > a .caret {
border-top-color: #999999;
border-bottom-color: #999999;
}
.note-editor .navbar-inverse .navbar-nav > .open > a .caret,
.note-editor .navbar-inverse .navbar-nav > .open > a:hover .caret,
.note-editor .navbar-inverse .navbar-nav > .open > a:focus .caret {
border-top-color: #ffffff;
border-bottom-color: #ffffff;
}
@media (max-width: 767px) {
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #080808;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #999999;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.note-editor .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
}
.note-editor .navbar-inverse .navbar-link {
color: #999999;
}
.note-editor .navbar-inverse .navbar-link:hover {
color: #ffffff;
}
.note-editor .breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.note-editor .breadcrumb > li {
display: inline-block;
}
.note-editor .breadcrumb > li + li:before {
content: "/\00a0";
padding: 0 5px;
color: #cccccc;
}
.note-editor .breadcrumb > .active {
color: #999999;
}
.note-editor .pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.note-editor .pagination > li {
display: inline;
}
.note-editor .pagination > li > a,
.note-editor .pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
line-height: 1.428571429;
text-decoration: none;
background-color: #ffffff;
border: 1px solid #dddddd;
margin-left: -1px;
}
.note-editor .pagination > li:first-child > a,
.note-editor .pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
}
.note-editor .pagination > li:last-child > a,
.note-editor .pagination > li:last-child > span {
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
}
.note-editor .pagination > li > a:hover,
.note-editor .pagination > li > span:hover,
.note-editor .pagination > li > a:focus,
.note-editor .pagination > li > span:focus {
background-color: #eeeeee;
}
.note-editor .pagination > .active > a,
.note-editor .pagination > .active > span,
.note-editor .pagination > .active > a:hover,
.note-editor .pagination > .active > span:hover,
.note-editor .pagination > .active > a:focus,
.note-editor .pagination > .active > span:focus {
z-index: 2;
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
cursor: default;
}
.note-editor .pagination > .disabled > span,
.note-editor .pagination > .disabled > span:hover,
.note-editor .pagination > .disabled > span:focus,
.note-editor .pagination > .disabled > a,
.note-editor .pagination > .disabled > a:hover,
.note-editor .pagination > .disabled > a:focus {
color: #999999;
background-color: #ffffff;
border-color: #dddddd;
cursor: not-allowed;
}
.note-editor .pagination-lg > li > a,
.note-editor .pagination-lg > li > span {
padding: 10px 16px;
font-size: 18px;
}
.note-editor .pagination-lg > li:first-child > a,
.note-editor .pagination-lg > li:first-child > span {
border-bottom-left-radius: 6px;
border-top-left-radius: 6px;
}
.note-editor .pagination-lg > li:last-child > a,
.note-editor .pagination-lg > li:last-child > span {
border-bottom-right-radius: 6px;
border-top-right-radius: 6px;
}
.note-editor .pagination-sm > li > a,
.note-editor .pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px;
}
.note-editor .pagination-sm > li:first-child > a,
.note-editor .pagination-sm > li:first-child > span {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.note-editor .pagination-sm > li:last-child > a,
.note-editor .pagination-sm > li:last-child > span {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.note-editor .pager {
padding-left: 0;
margin: 20px 0;
list-style: none;
text-align: center;
}
.note-editor .pager:before,
.note-editor .pager:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .pager:after {
clear: both;
}
.note-editor .pager:before,
.note-editor .pager:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .pager:after {
clear: both;
}
.note-editor .pager li {
display: inline;
}
.note-editor .pager li > a,
.note-editor .pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 15px;
}
.note-editor .pager li > a:hover,
.note-editor .pager li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.note-editor .pager .next > a,
.note-editor .pager .next > span {
float: right;
}
.note-editor .pager .previous > a,
.note-editor .pager .previous > span {
float: left;
}
.note-editor .pager .disabled > a,
.note-editor .pager .disabled > a:hover,
.note-editor .pager .disabled > a:focus,
.note-editor .pager .disabled > span {
color: #999999;
background-color: #ffffff;
cursor: not-allowed;
}
.note-editor .label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
.note-editor .label[href]:hover,
.note-editor .label[href]:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.note-editor .label:empty {
display: none;
}
.note-editor .label-default {
background-color: #999999;
}
.note-editor .label-default[href]:hover,
.note-editor .label-default[href]:focus {
background-color: #808080;
}
.note-editor .label-primary {
background-color: #428bca;
}
.note-editor .label-primary[href]:hover,
.note-editor .label-primary[href]:focus {
background-color: #3071a9;
}
.note-editor .label-success {
background-color: #5cb85c;
}
.note-editor .label-success[href]:hover,
.note-editor .label-success[href]:focus {
background-color: #449d44;
}
.note-editor .label-info {
background-color: #5bc0de;
}
.note-editor .label-info[href]:hover,
.note-editor .label-info[href]:focus {
background-color: #31b0d5;
}
.note-editor .label-warning {
background-color: #f0ad4e;
}
.note-editor .label-warning[href]:hover,
.note-editor .label-warning[href]:focus {
background-color: #ec971f;
}
.note-editor .label-danger {
background-color: #d9534f;
}
.note-editor .label-danger[href]:hover,
.note-editor .label-danger[href]:focus {
background-color: #c9302c;
}
.note-editor .badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
color: #ffffff;
line-height: 1;
vertical-align: baseline;
white-space: nowrap;
text-align: center;
background-color: #999999;
border-radius: 10px;
}
.note-editor .badge:empty {
display: none;
}
.note-editor a.badge:hover,
.note-editor a.badge:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.note-editor .btn .badge {
position: relative;
top: -1px;
}
.note-editor a.list-group-item.active > .badge,
.note-editor .nav-pills > .active > a > .badge {
color: #428bca;
background-color: #ffffff;
}
.note-editor .nav-pills > li > a > .badge {
margin-left: 3px;
}
.note-editor .jumbotron {
padding: 30px;
margin-bottom: 30px;
font-size: 21px;
font-weight: 200;
line-height: 2.1428571435;
color: inherit;
background-color: #eeeeee;
}
.note-editor .jumbotron h1 {
line-height: 1;
color: inherit;
}
.note-editor .jumbotron p {
line-height: 1.4;
}
.container .note-editor .jumbotron {
border-radius: 6px;
}
@media screen and (min-width: 768px) {
.note-editor .jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .note-editor .jumbotron {
padding-left: 60px;
padding-right: 60px;
}
.note-editor .jumbotron h1 {
font-size: 63px;
}
}
.note-editor .thumbnail {
padding: 4px;
line-height: 1.428571429;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
display: block;
margin-bottom: 20px;
}
.note-editor .thumbnail > img {
display: block;
max-width: 100%;
height: auto;
}
.note-editor a.thumbnail:hover,
.note-editor a.thumbnail:focus,
.note-editor a.thumbnail.active {
border-color: #428bca;
}
.note-editor .thumbnail > img {
margin-left: auto;
margin-right: auto;
}
.note-editor .thumbnail .caption {
padding: 9px;
color: #333333;
}
.note-editor .alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.note-editor .alert h4 {
margin-top: 0;
color: inherit;
}
.note-editor .alert .alert-link {
font-weight: bold;
}
.note-editor .alert > p,
.note-editor .alert > ul {
margin-bottom: 0;
}
.note-editor .alert > p + p {
margin-top: 5px;
}
.note-editor .alert-dismissable {
padding-right: 35px;
}
.note-editor .alert-dismissable .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.note-editor .alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
}
.note-editor .alert-success hr {
border-top-color: #c9e2b3;
}
.note-editor .alert-success .alert-link {
color: #356635;
}
.note-editor .alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #3a87ad;
}
.note-editor .alert-info hr {
border-top-color: #a6e1ec;
}
.note-editor .alert-info .alert-link {
color: #2d6987;
}
.note-editor .alert-warning {
background-color: #fcf8e3;
border-color: #faebcc;
color: #c09853;
}
.note-editor .alert-warning hr {
border-top-color: #f7e1b5;
}
.note-editor .alert-warning .alert-link {
color: #a47e3c;
}
.note-editor .alert-danger {
background-color: #f2dede;
border-color: #ebccd1;
color: #b94a48;
}
.note-editor .alert-danger hr {
border-top-color: #e4b9c0;
}
.note-editor .alert-danger .alert-link {
color: #953b39;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-moz-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-o-keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.note-editor .progress {
overflow: hidden;
height: 20px;
margin-bottom: 20px;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.note-editor .progress-bar {
float: left;
width: 0%;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #ffffff;
text-align: center;
background-color: #428bca;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.note-editor .progress-striped .progress-bar {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 40px 40px;
}
.note-editor .progress.active .progress-bar {
-webkit-animation: progress-bar-stripes 2s linear infinite;
-moz-animation: progress-bar-stripes 2s linear infinite;
-ms-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
}
.note-editor .progress-bar-success {
background-color: #5cb85c;
}
.progress-striped .note-editor .progress-bar-success {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .progress-bar-info {
background-color: #5bc0de;
}
.progress-striped .note-editor .progress-bar-info {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .progress-bar-warning {
background-color: #f0ad4e;
}
.progress-striped .note-editor .progress-bar-warning {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .progress-bar-danger {
background-color: #d9534f;
}
.progress-striped .note-editor .progress-bar-danger {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.note-editor .media,
.note-editor .media-body {
overflow: hidden;
zoom: 1;
}
.note-editor .media,
.note-editor .media .media {
margin-top: 15px;
}
.note-editor .media:first-child {
margin-top: 0;
}
.note-editor .media-object {
display: block;
}
.note-editor .media-heading {
margin: 0 0 5px;
}
.note-editor .media > .pull-left {
margin-right: 10px;
}
.note-editor .media > .pull-right {
margin-left: 10px;
}
.note-editor .media-list {
padding-left: 0;
list-style: none;
}
.note-editor .list-group {
margin-bottom: 20px;
padding-left: 0;
}
.note-editor .list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #ffffff;
border: 1px solid #dddddd;
}
.note-editor .list-group-item:first-child {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
.note-editor .list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.note-editor .list-group-item > .badge {
float: right;
}
.note-editor .list-group-item > .badge + .badge {
margin-right: 5px;
}
.note-editor a.list-group-item {
color: #555555;
}
.note-editor a.list-group-item .list-group-item-heading {
color: #333333;
}
.note-editor a.list-group-item:hover,
.note-editor a.list-group-item:focus {
text-decoration: none;
background-color: #f5f5f5;
}
.note-editor a.list-group-item.active,
.note-editor a.list-group-item.active:hover,
.note-editor a.list-group-item.active:focus {
z-index: 2;
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
}
.note-editor a.list-group-item.active .list-group-item-heading,
.note-editor a.list-group-item.active:hover .list-group-item-heading,
.note-editor a.list-group-item.active:focus .list-group-item-heading {
color: inherit;
}
.note-editor a.list-group-item.active .list-group-item-text,
.note-editor a.list-group-item.active:hover .list-group-item-text,
.note-editor a.list-group-item.active:focus .list-group-item-text {
color: #e1edf7;
}
.note-editor .list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.note-editor .list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
.note-editor .panel {
margin-bottom: 20px;
background-color: #ffffff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.note-editor .panel-body {
padding: 15px;
}
.note-editor .panel-body:before,
.note-editor .panel-body:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .panel-body:after {
clear: both;
}
.note-editor .panel-body:before,
.note-editor .panel-body:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.note-editor .panel-body:after {
clear: both;
}
.note-editor .panel > .list-group {
margin-bottom: 0;
}
.note-editor .panel > .list-group .list-group-item {
border-width: 1px 0;
}
.note-editor .panel > .list-group .list-group-item:first-child {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.note-editor .panel > .list-group .list-group-item:last-child {
border-bottom: 0;
}
.note-editor .panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.note-editor .panel > .table,
.note-editor .panel > .table-responsive {
margin-bottom: 0;
}
.note-editor .panel > .panel-body + .table,
.note-editor .panel > .panel-body + .table-responsive {
border-top: 1px solid #dddddd;
}
.note-editor .panel > .table-bordered,
.note-editor .panel > .table-responsive > .table-bordered {
border: 0;
}
.note-editor .panel > .table-bordered > thead > tr > th:first-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
.note-editor .panel > .table-bordered > tbody > tr > th:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
.note-editor .panel > .table-bordered > tfoot > tr > th:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.note-editor .panel > .table-bordered > thead > tr > td:first-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
.note-editor .panel > .table-bordered > tbody > tr > td:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
.note-editor .panel > .table-bordered > tfoot > tr > td:first-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.note-editor .panel > .table-bordered > thead > tr > th:last-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
.note-editor .panel > .table-bordered > tbody > tr > th:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
.note-editor .panel > .table-bordered > tfoot > tr > th:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.note-editor .panel > .table-bordered > thead > tr > td:last-child,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
.note-editor .panel > .table-bordered > tbody > tr > td:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
.note-editor .panel > .table-bordered > tfoot > tr > td:last-child,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.note-editor .panel > .table-bordered > thead > tr:last-child > th,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr:last-child > th,
.note-editor .panel > .table-bordered > tbody > tr:last-child > th,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
.note-editor .panel > .table-bordered > tfoot > tr:last-child > th,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th,
.note-editor .panel > .table-bordered > thead > tr:last-child > td,
.note-editor .panel > .table-responsive > .table-bordered > thead > tr:last-child > td,
.note-editor .panel > .table-bordered > tbody > tr:last-child > td,
.note-editor .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
.note-editor .panel > .table-bordered > tfoot > tr:last-child > td,
.note-editor .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
.note-editor .panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.note-editor .panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
}
.note-editor .panel-title > a {
color: inherit;
}
.note-editor .panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #dddddd;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.note-editor .panel-group .panel {
margin-bottom: 0;
border-radius: 4px;
overflow: hidden;
}
.note-editor .panel-group .panel + .panel {
margin-top: 5px;
}
.note-editor .panel-group .panel-heading {
border-bottom: 0;
}
.note-editor .panel-group .panel-heading + .panel-collapse .panel-body {
border-top: 1px solid #dddddd;
}
.note-editor .panel-group .panel-footer {
border-top: 0;
}
.note-editor .panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #dddddd;
}
.note-editor .panel-default {
border-color: #dddddd;
}
.note-editor .panel-default > .panel-heading {
color: #333333;
background-color: #f5f5f5;
border-color: #dddddd;
}
.note-editor .panel-default > .panel-heading + .panel-collapse .panel-body {
border-top-color: #dddddd;
}
.note-editor .panel-default > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #dddddd;
}
.note-editor .panel-primary {
border-color: #428bca;
}
.note-editor .panel-primary > .panel-heading {
color: #ffffff;
background-color: #428bca;
border-color: #428bca;
}
.note-editor .panel-primary > .panel-heading + .panel-collapse .panel-body {
border-top-color: #428bca;
}
.note-editor .panel-primary > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #428bca;
}
.note-editor .panel-success {
border-color: #d6e9c6;
}
.note-editor .panel-success > .panel-heading {
color: #468847;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.note-editor .panel-success > .panel-heading + .panel-collapse .panel-body {
border-top-color: #d6e9c6;
}
.note-editor .panel-success > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #d6e9c6;
}
.note-editor .panel-warning {
border-color: #faebcc;
}
.note-editor .panel-warning > .panel-heading {
color: #c09853;
background-color: #fcf8e3;
border-color: #faebcc;
}
.note-editor .panel-warning > .panel-heading + .panel-collapse .panel-body {
border-top-color: #faebcc;
}
.note-editor .panel-warning > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #faebcc;
}
.note-editor .panel-danger {
border-color: #ebccd1;
}
.note-editor .panel-danger > .panel-heading {
color: #b94a48;
background-color: #f2dede;
border-color: #ebccd1;
}
.note-editor .panel-danger > .panel-heading + .panel-collapse .panel-body {
border-top-color: #ebccd1;
}
.note-editor .panel-danger > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #ebccd1;
}
.note-editor .panel-info {
border-color: #bce8f1;
}
.note-editor .panel-info > .panel-heading {
color: #3a87ad;
background-color: #d9edf7;
border-color: #bce8f1;
}
.note-editor .panel-info > .panel-heading + .panel-collapse .panel-body {
border-top-color: #bce8f1;
}
.note-editor .panel-info > .panel-footer + .panel-collapse .panel-body {
border-bottom-color: #bce8f1;
}
.note-editor .well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.note-editor .well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, 0.15);
}
.note-editor .well-lg {
padding: 24px;
border-radius: 6px;
}
.note-editor .well-sm {
padding: 9px;
border-radius: 3px;
}
.note-editor .close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.note-editor .close:hover,
.note-editor .close:focus {
color: #000000;
text-decoration: none;
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
}
button.note-editor .close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.modal-open {
overflow: hidden;
}
.modal {
display: none;
overflow: auto;
overflow-y: scroll;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
}
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
transform: translate(0, -25%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-moz-transition: -moz-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-dialog {
margin-left: auto;
margin-right: auto;
width: auto;
padding: 10px;
z-index: 1050;
}
.modal-content {
position: relative;
background-color: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
background-clip: padding-box;
outline: none;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1030;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
min-height: 16.428571429px;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.428571429;
}
.modal-body {
position: relative;
padding: 20px;
}
.modal-footer {
margin-top: 15px;
padding: 19px 20px 20px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer:before,
.modal-footer:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.modal-footer:after {
clear: both;
}
.modal-footer:before,
.modal-footer:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.modal-footer:after {
clear: both;
}
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
@media screen and (min-width: 768px) {
.modal-dialog {
width: 600px;
padding-top: 30px;
padding-bottom: 30px;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
}
.tooltip {
position: absolute;
z-index: 1030;
display: block;
visibility: visible;
font-size: 12px;
line-height: 1.4;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
margin-top: -3px;
padding: 5px 0;
}
.tooltip.right {
margin-left: 3px;
padding: 0 5px;
}
.tooltip.bottom {
margin-top: 3px;
padding: 5px 0;
}
.tooltip.left {
margin-left: -3px;
padding: 0 5px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
text-decoration: none;
background-color: #000000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
left: 5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
right: 5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
left: 5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
right: 5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
max-width: 276px;
padding: 1px;
text-align: left;
background-color: #ffffff;
background-clip: padding-box;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
white-space: normal;
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
margin: 0;
padding: 8px 14px;
font-size: 14px;
font-weight: normal;
line-height: 18px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}
.popover-content {
padding: 9px 14px;
}
.popover .arrow,
.popover .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.popover .arrow {
border-width: 11px;
}
.popover .arrow:after {
border-width: 10px;
content: "";
}
.popover.top .arrow {
left: 50%;
margin-left: -11px;
border-bottom-width: 0;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
bottom: -11px;
}
.popover.top .arrow:after {
content: " ";
bottom: 1px;
margin-left: -10px;
border-bottom-width: 0;
border-top-color: #ffffff;
}
.popover.right .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-left-width: 0;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25);
}
.popover.right .arrow:after {
content: " ";
left: 1px;
bottom: -10px;
border-left-width: 0;
border-right-color: #ffffff;
}
.popover.bottom .arrow {
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
top: -11px;
}
.popover.bottom .arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #ffffff;
}
.popover.left .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25);
}
.popover.left .arrow:after {
content: " ";
right: 1px;
border-right-width: 0;
border-left-color: #ffffff;
bottom: -10px;
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%;
}
.carousel-inner > .item {
display: none;
position: relative;
-webkit-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
line-height: 1;
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 15%;
opacity: 0.5;
filter: alpha(opacity=50);
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-control.left {
background-image: -webkit-gradient(linear, 0% top, 100% top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0%), color-stop(rgba(0, 0, 0, 0.0001) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
}
.carousel-control.right {
left: auto;
right: 0;
background-image: -webkit-gradient(linear, 0% top, 100% top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0%), color-stop(rgba(0, 0, 0, 0.5) 100%));
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
}
.carousel-control:hover,
.carousel-control:focus {
color: #ffffff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .glyphicon-chevron-left {
left: 50%;
}
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-right {
right: 50%;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
font-family: serif;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
margin-left: -30%;
padding-left: 0;
list-style: none;
text-align: center;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
border: 1px solid #ffffff;
border-radius: 10px;
cursor: pointer;
}
.carousel-indicators .active {
margin: 0;
width: 12px;
height: 12px;
background-color: #ffffff;
}
.carousel-caption {
position: absolute;
left: 15%;
right: 15%;
bottom: 20px;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .glyphicons-chevron-left,
.carousel-control .glyphicons-chevron-right,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -15px;
margin-left: -15px;
font-size: 30px;
}
.carousel-caption {
left: 20%;
right: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after {
content: " ";
/* 1 */
display: table;
/* 2 */
}
.clearfix:after {
clear: both;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
visibility: hidden !important;
}
.affix {
position: fixed;
}
@-ms-viewport {
width: device-width;
}
.visible-xs,
tr.visible-xs,
th.visible-xs,
td.visible-xs {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-xs.visible-sm {
display: block !important;
}
tr.visible-xs.visible-sm {
display: table-row !important;
}
th.visible-xs.visible-sm,
td.visible-xs.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-xs.visible-md {
display: block !important;
}
tr.visible-xs.visible-md {
display: table-row !important;
}
th.visible-xs.visible-md,
td.visible-xs.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-xs.visible-lg {
display: block !important;
}
tr.visible-xs.visible-lg {
display: table-row !important;
}
th.visible-xs.visible-lg,
td.visible-xs.visible-lg {
display: table-cell !important;
}
}
.visible-sm,
tr.visible-sm,
th.visible-sm,
td.visible-sm {
display: none !important;
}
@media (max-width: 767px) {
.visible-sm.visible-xs {
display: block !important;
}
tr.visible-sm.visible-xs {
display: table-row !important;
}
th.visible-sm.visible-xs,
td.visible-sm.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-sm.visible-md {
display: block !important;
}
tr.visible-sm.visible-md {
display: table-row !important;
}
th.visible-sm.visible-md,
td.visible-sm.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-sm.visible-lg {
display: block !important;
}
tr.visible-sm.visible-lg {
display: table-row !important;
}
th.visible-sm.visible-lg,
td.visible-sm.visible-lg {
display: table-cell !important;
}
}
.visible-md,
tr.visible-md,
th.visible-md,
td.visible-md {
display: none !important;
}
@media (max-width: 767px) {
.visible-md.visible-xs {
display: block !important;
}
tr.visible-md.visible-xs {
display: table-row !important;
}
th.visible-md.visible-xs,
td.visible-md.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-md.visible-sm {
display: block !important;
}
tr.visible-md.visible-sm {
display: table-row !important;
}
th.visible-md.visible-sm,
td.visible-md.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-md.visible-lg {
display: block !important;
}
tr.visible-md.visible-lg {
display: table-row !important;
}
th.visible-md.visible-lg,
td.visible-md.visible-lg {
display: table-cell !important;
}
}
.visible-lg,
tr.visible-lg,
th.visible-lg,
td.visible-lg {
display: none !important;
}
@media (max-width: 767px) {
.visible-lg.visible-xs {
display: block !important;
}
tr.visible-lg.visible-xs {
display: table-row !important;
}
th.visible-lg.visible-xs,
td.visible-lg.visible-xs {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-lg.visible-sm {
display: block !important;
}
tr.visible-lg.visible-sm {
display: table-row !important;
}
th.visible-lg.visible-sm,
td.visible-lg.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-lg.visible-md {
display: block !important;
}
tr.visible-lg.visible-md {
display: table-row !important;
}
th.visible-lg.visible-md,
td.visible-lg.visible-md {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
.hidden-xs {
display: block !important;
}
tr.hidden-xs {
display: table-row !important;
}
th.hidden-xs,
td.hidden-xs {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-xs,
tr.hidden-xs,
th.hidden-xs,
td.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-xs.hidden-sm,
tr.hidden-xs.hidden-sm,
th.hidden-xs.hidden-sm,
td.hidden-xs.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-xs.hidden-md,
tr.hidden-xs.hidden-md,
th.hidden-xs.hidden-md,
td.hidden-xs.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-xs.hidden-lg,
tr.hidden-xs.hidden-lg,
th.hidden-xs.hidden-lg,
td.hidden-xs.hidden-lg {
display: none !important;
}
}
.hidden-sm {
display: block !important;
}
tr.hidden-sm {
display: table-row !important;
}
th.hidden-sm,
td.hidden-sm {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-sm.hidden-xs,
tr.hidden-sm.hidden-xs,
th.hidden-sm.hidden-xs,
td.hidden-sm.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm,
tr.hidden-sm,
th.hidden-sm,
td.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-sm.hidden-md,
tr.hidden-sm.hidden-md,
th.hidden-sm.hidden-md,
td.hidden-sm.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-sm.hidden-lg,
tr.hidden-sm.hidden-lg,
th.hidden-sm.hidden-lg,
td.hidden-sm.hidden-lg {
display: none !important;
}
}
.hidden-md {
display: block !important;
}
tr.hidden-md {
display: table-row !important;
}
th.hidden-md,
td.hidden-md {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-md.hidden-xs,
tr.hidden-md.hidden-xs,
th.hidden-md.hidden-xs,
td.hidden-md.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-md.hidden-sm,
tr.hidden-md.hidden-sm,
th.hidden-md.hidden-sm,
td.hidden-md.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md,
tr.hidden-md,
th.hidden-md,
td.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-md.hidden-lg,
tr.hidden-md.hidden-lg,
th.hidden-md.hidden-lg,
td.hidden-md.hidden-lg {
display: none !important;
}
}
.hidden-lg {
display: block !important;
}
tr.hidden-lg {
display: table-row !important;
}
th.hidden-lg,
td.hidden-lg {
display: table-cell !important;
}
@media (max-width: 767px) {
.hidden-lg.hidden-xs,
tr.hidden-lg.hidden-xs,
th.hidden-lg.hidden-xs,
td.hidden-lg.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-lg.hidden-sm,
tr.hidden-lg.hidden-sm,
th.hidden-lg.hidden-sm,
td.hidden-lg.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-lg.hidden-md,
tr.hidden-lg.hidden-md,
th.hidden-lg.hidden-md,
td.hidden-lg.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg,
tr.hidden-lg,
th.hidden-lg,
td.hidden-lg {
display: none !important;
}
}
.visible-print,
tr.visible-print,
th.visible-print,
td.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
.hidden-print,
tr.hidden-print,
th.hidden-print,
td.hidden-print {
display: none !important;
}
}
| {
"content_hash": "eb00282b5e8c90b6bd3531566f680a34",
"timestamp": "",
"source": "github",
"line_count": 5970,
"max_line_length": 553,
"avg_line_length": 24.525293132328308,
"alnum_prop": 0.6667918806687794,
"repo_name": "pizarron/whiteboard",
"id": "5ddbf6006f571ad264f6f2828a35e27f8064d8a3",
"size": "146416",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Whiteboard.Web/Content/css/plugins/summernote/summernote-bs3.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "105"
},
{
"name": "C#",
"bytes": "302407"
},
{
"name": "CSS",
"bytes": "275253"
},
{
"name": "JavaScript",
"bytes": "862823"
},
{
"name": "Shell",
"bytes": "1216"
}
],
"symlink_target": ""
} |
package won.protocol.model;
import java.net.URI;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* User: sbyim Date: 12.11.13
*/
@Entity
@Table(name = "wonNode")
public class WonNode {
@Id
@GeneratedValue
@Column(name = "id")
private Long id;
@Column(name = "wonNodeURI", unique = true)
@Convert(converter = URIConverter.class)
private URI wonNodeURI;
@Column(name = "brokerURI")
@Convert(converter = URIConverter.class)
private URI brokerURI;
@Column(name = "ownerProtocolEndpoint")
private String ownerProtocolEndpoint;
@Column(name = "startingComponent")
private String startingComponent;
@Column(name = "brokerComponent")
private String brokerComponent;
private String ownerApplicationID;
public String getOwnerProtocolEndpoint() {
return ownerProtocolEndpoint;
}
public void setOwnerProtocolEndpoint(String ownerProtocolEndpoint) {
this.ownerProtocolEndpoint = ownerProtocolEndpoint;
}
public URI getWonNodeURI() {
return wonNodeURI;
}
public void setWonNodeURI(URI wonNodeURI) {
this.wonNodeURI = wonNodeURI;
}
public String getOwnerApplicationID() {
return ownerApplicationID;
}
public void setOwnerApplicationID(String ownerApplicationID) {
this.ownerApplicationID = ownerApplicationID;
}
public URI getBrokerURI() {
return brokerURI;
}
public void setBrokerURI(URI brokerURI) {
this.brokerURI = brokerURI;
}
public String getStartingComponent() {
return startingComponent;
}
public void setStartingComponent(String startingComponent) {
this.startingComponent = startingComponent;
}
public String getBrokerComponent() {
return brokerComponent;
}
public void setBrokerComponent(String brokerComponent) {
this.brokerComponent = brokerComponent;
}
}
| {
"content_hash": "c57d612ad2fa00af9baf7fca7c2324c8",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 72,
"avg_line_length": 24.892857142857142,
"alnum_prop": 0.6996652319464371,
"repo_name": "researchstudio-sat/webofneeds",
"id": "618a3e895c1f0a6ac47522b95f1b10ff7877efd7",
"size": "2700",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webofneeds/won-core/src/main/java/won/protocol/model/WonNode.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6244"
},
{
"name": "Dockerfile",
"bytes": "15930"
},
{
"name": "EJS",
"bytes": "684"
},
{
"name": "HTML",
"bytes": "16097"
},
{
"name": "Java",
"bytes": "5108851"
},
{
"name": "JavaScript",
"bytes": "1884810"
},
{
"name": "PLpgSQL",
"bytes": "20620"
},
{
"name": "Perl",
"bytes": "2060"
},
{
"name": "PowerShell",
"bytes": "416"
},
{
"name": "Python",
"bytes": "52265"
},
{
"name": "SCSS",
"bytes": "244767"
},
{
"name": "Shell",
"bytes": "70847"
},
{
"name": "TypeScript",
"bytes": "5534"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <!-- Use Chrome Frame in IE -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Showcase of different 3D Tiles formats.">
<meta name="cesium-sandcastle-labels" content="3D Tiles">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
@import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar">
<select data-bind="options: tilesets, optionsText: 'name', value: selectedTileset, optionsCaption: 'Choose a Tileset...'"></select>
<div><input type="checkbox" data-bind="checked: shadows"> Shadows</div>
</div>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer', {
shadows : true
});
viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
var inspectorViewModel = viewer.cesium3DTilesInspector.viewModel;
viewer.clock.currentTime = new Cesium.JulianDate(2457522.154792);
var scene = viewer.scene;
var tileset;
var viewModel = {
tilesets: [
{
name: 'Tileset',
resource: Cesium.IonResource.fromAssetId(3883)
}, {
name: 'Translucent',
resource: Cesium.IonResource.fromAssetId(3871)
}, {
name: 'Translucent/Opaque',
resource: Cesium.IonResource.fromAssetId(3872)
}, {
name: 'Multi-color',
resource: Cesium.IonResource.fromAssetId(3870)
}, {
name: 'Request Volume',
resource: Cesium.IonResource.fromAssetId(3884)
}, {
name: 'Batched',
resource: Cesium.IonResource.fromAssetId(3873)
}, {
name: 'Instanced',
resource: Cesium.IonResource.fromAssetId(3877)
}, {
name: 'Instanced/Orientation',
resource: Cesium.IonResource.fromAssetId(3876)
}, {
name: 'Composite',
resource: Cesium.IonResource.fromAssetId(3874)
}, {
name: 'PointCloud',
resource: Cesium.IonResource.fromAssetId(3881)
}, {
name: 'PointCloudConstantColor',
resource: Cesium.IonResource.fromAssetId(3879)
}, {
name: 'PointCloudNormals',
resource: Cesium.IonResource.fromAssetId(3880)
}, {
name: 'PointCloudBatched',
resource: Cesium.IonResource.fromAssetId(3878)
}
],
selectedTileset: undefined,
shadows: true
};
Cesium.knockout.track(viewModel);
var toolbar = document.getElementById('toolbar');
Cesium.knockout.applyBindings(viewModel, toolbar);
Cesium.knockout.getObservable(viewModel, 'shadows').subscribe(function(enabled) {
viewer.shadows = enabled;
});
Cesium.knockout.getObservable(viewModel, 'selectedTileset').subscribe(function(options) {
if (Cesium.defined(tileset)) {
scene.primitives.remove(tileset);
}
if (!Cesium.defined(options)) {
inspectorViewModel.tileset = undefined;
return;
}
tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : options.resource
}));
tileset.readyPromise.then(function() {
inspectorViewModel.tileset = tileset;
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0, -2.0, Math.max(100.0 - tileset.boundingSphere.radius, 0.0)));
var properties = tileset.properties;
if (Cesium.defined(properties) && Cesium.defined(properties.Height)) {
tileset.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["${Height} >= 83", "color('purple', 0.5)"],
["${Height} >= 80", "color('red')"],
["${Height} >= 70", "color('orange')"],
["${Height} >= 12", "color('yellow')"],
["${Height} >= 7", "color('lime')"],
["${Height} >= 1", "color('cyan')"],
["true", "color('blue')"]
]
}
});
}
}).otherwise(function(error) {
throw(error);
});
});
viewModel.selectedTileset = viewModel.tilesets[0];
var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
handler.setInputAction(function(movement) {
var feature = inspectorViewModel.feature;
if (Cesium.defined(feature)) {
var propertyNames = feature.getPropertyNames();
var length = propertyNames.length;
for (var i = 0; i < length; ++i) {
var propertyName = propertyNames[i];
console.log(propertyName + ': ' + feature.getProperty(propertyName));
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
handler.setInputAction(function(movement) {
var feature = inspectorViewModel.feature;
if (Cesium.defined(feature)) {
feature.show = false;
}
}, Cesium.ScreenSpaceEventType.MIDDLE_CLICK);
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
}
</script>
</body>
</html>
| {
"content_hash": "37f0af79cef50f27f874eb5c8bc17bf0",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 135,
"avg_line_length": 34.35294117647059,
"alnum_prop": 0.6037671232876712,
"repo_name": "oterral/cesium",
"id": "9cca466f141ff185949f76814775aec76b62dbe7",
"size": "5840",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Apps/Sandcastle/gallery/3D Tiles Formats.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "659289"
},
{
"name": "GLSL",
"bytes": "247456"
},
{
"name": "HTML",
"bytes": "2008592"
},
{
"name": "JavaScript",
"bytes": "23971138"
},
{
"name": "Shell",
"bytes": "291"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "6ae9e5344dafe9e244466ad7e8a9215a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "0823be37ca2ce54a3079f48cedbfc6f8c2051bc4",
"size": "172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Chenopodiaceae/Salsola/Salsola decumbens/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace frontend\controllers;
use Yii;
use app\models\RefVenueAduan;
use frontend\models\RefVenueAduanSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* RefVenueAduanController implements the CRUD actions for RefVenueAduan model.
*/
class RefVenueAduanController extends Controller
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all RefVenueAduan models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new RefVenueAduanSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single RefVenueAduan model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new RefVenueAduan model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new RefVenueAduan();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing RefVenueAduan model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing RefVenueAduan model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the RefVenueAduan model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return RefVenueAduan the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = RefVenueAduan::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
| {
"content_hash": "a4d877e7432aae4b16328b08bfc9709a",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 85,
"avg_line_length": 26.04032258064516,
"alnum_prop": 0.5435119231960359,
"repo_name": "hung101/kbs",
"id": "59de2d1b12d169715edfb7373c10c7c1da091546",
"size": "3229",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/controllers/RefVenueAduanController.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "113"
},
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "4999813"
},
{
"name": "HTML",
"bytes": "32884422"
},
{
"name": "JavaScript",
"bytes": "38543640"
},
{
"name": "PHP",
"bytes": "30558998"
},
{
"name": "PowerShell",
"bytes": "936"
},
{
"name": "Shell",
"bytes": "5561"
}
],
"symlink_target": ""
} |
<h4 id="v1---advance-notice" class="text-blue">
Appointment announcement
</h4>
<p>
If you want the recipient to get a call from the carrier some time before the shipment will arrive
at its destination you can specify the phone number of the recipient via our additional service
advance_notice.
</p>
<p class="mt-m">
<strong>Requirements:</strong>
</p>
<ul class="list-outside list-disc pl-m">
<li>
<code>service</code> has to be <code><em>standard</em></code>
</li>
<li>
<code>package.type</code> can be <code><em>disposable_pallet</em></code>,
<code><em>euro_pallet</em></code> or
<code><em>cargo_international_large_parcel</em></code>
</li>
</ul>
<section class="shadow my-m">
<article class="border-b">
<div class="border-l-2 border-transparent">
{% include utils/toggle_element.html target="#v1_advance_notice_togglebox" link_text="Show example"%}
<div class="px-4 pb-2 text-grey-darkest hidden" id="v1_advance_notice_togglebox">
<div class="mt-m">
{% highlight http %}
POST https://api.shipcloud.io/v1/shipments
{% endhighlight %}
{% highlight json %}
{
"from": {
"first_name": "Serge",
"last_name": "Sender",
"company": "Sender Corp.",
"street": "Sender Str.",
"street_no": "99",
"zip_code": "20148",
"city": "Hamburg",
"country": "DE"
},
"to": {
"first_name": "Roger",
"last_name": "Receiver",
"street": "Receiver Str.",
"street_no": "1",
"city": "Hamburg",
"zip_code": "20535",
"country": "DE"
},
"package": {
"weight": 40,
"length": 1200,
"width": 800,
"height": 144,
"type": "euro_pallet"
},
"additional_services": [
{
"name": "advance_notice",
"properties": {
"phone": "015112345678"
}
}
],
"carrier": "cargo_international",
"service": "standard",
"description": "a short description of the shipment content",
"reference_number": "order's reference number",
"notification_email": "receiver@mail.com",
"create_shipping_label": true
}
{% endhighlight %}
</div>
</div>
</div>
</article>
</section>
| {
"content_hash": "b70842fdbefd90fdd3c4c79dd4ea4083",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 107,
"avg_line_length": 25.488095238095237,
"alnum_prop": 0.6011209715086409,
"repo_name": "shipcloud/shipcloud.github.io",
"id": "2ac8518ea105ccddb256a772bbe00d51de106bd3",
"size": "2141",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/examples/carriers/cargo_international/v1/additional_services/advance_notice.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20529"
},
{
"name": "HTML",
"bytes": "303567"
},
{
"name": "JavaScript",
"bytes": "154176"
},
{
"name": "Ruby",
"bytes": "7283"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_111) on Sat Dec 09 18:55:13 ART 2017 -->
<title>BaboonPetriCore</title>
<meta name="date" content="2017-12-09">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="BaboonPetriCore";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BaboonPetriCore.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/unc/lac/baboon/petri/BaboonPetriCore.html" target="_top">Frames</a></li>
<li><a href="BaboonPetriCore.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.unc.lac.baboon.petri</div>
<h2 title="Class BaboonPetriCore" class="title">Class BaboonPetriCore</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.unc.lac.baboon.petri.BaboonPetriCore</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">BaboonPetriCore</span>
extends java.lang.Object</pre>
<div class="block">BaboonPetriCore is a wrapper containing the objects that are necessary for
initialize and execute petri nets.</div>
<dl>
<dt><span class="simpleTagLabel">Version:</span></dt>
<dd>1.0</dd>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Ariel Ivan Rabinovich, Juan Jose Arce Giacobbe</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>PetriMonitor</code>,
<code>PetriNet</code></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/unc/lac/baboon/petri/BaboonPetriCore.html#BaboonPetriCore-java.lang.String-org.unc.lac.javapetriconcurrencymonitor.petrinets.factory.PetriNetFactory.petriNetType-java.lang.Class-">BaboonPetriCore</a></span>(java.lang.String pnmlFilePath,
org.unc.lac.javapetriconcurrencymonitor.petrinets.factory.PetriNetFactory.petriNetType type,
java.lang.Class<A> firingPolicy)</code>
<div class="block">Creates the Petri Net core of the application by using the pnml file
provided as an argument, the petri net type and the transition firing
policy.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/unc/lac/baboon/petri/BaboonPetriCore.html#changeFiringPolicy-org.unc.lac.javapetriconcurrencymonitor.monitor.policies.TransitionsPolicy-">changeFiringPolicy</a></span>(org.unc.lac.javapetriconcurrencymonitor.monitor.policies.TransitionsPolicy firingPolicy)</code>
<div class="block">Changes the petri monitor transition firing policy.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/unc/lac/baboon/petri/BaboonPetriCore.html#fireTransition-java.lang.String-boolean-">fireTransition</a></span>(java.lang.String transitionName,
boolean perennialFiring)</code>
<div class="block">Fires a transition by using petri monitor.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.lang.Integer[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/unc/lac/baboon/petri/BaboonPetriCore.html#getMarking--">getMarking</a></span>()</code>
<div class="block">This method returns the current marking on the Petri Net core of the application</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/unc/lac/baboon/petri/BaboonPetriCore.html#initializePetriNet--">initializePetriNet</a></span>()</code>
<div class="block">Initializes the petri net.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>rx.Subscription</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/unc/lac/baboon/petri/BaboonPetriCore.html#listenToTransitionInforms-java.lang.String-rx.Observer-">listenToTransitionInforms</a></span>(java.lang.String _transitionName,
rx.Observer<java.lang.String> _observer)</code>
<div class="block">Subscribe the given observer to the given transition events if it's informed</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/unc/lac/baboon/petri/BaboonPetriCore.html#setGuard-java.lang.String-boolean-">setGuard</a></span>(java.lang.String guardName,
boolean newValue)</code>
<div class="block">Sets a guard by using petri monitor.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="BaboonPetriCore-java.lang.String-org.unc.lac.javapetriconcurrencymonitor.petrinets.factory.PetriNetFactory.petriNetType-java.lang.Class-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>BaboonPetriCore</h4>
<pre>public BaboonPetriCore(java.lang.String pnmlFilePath,
org.unc.lac.javapetriconcurrencymonitor.petrinets.factory.PetriNetFactory.petriNetType type,
java.lang.Class<A> firingPolicy)
throws <a href="../../../../../org/unc/lac/baboon/exceptions/BadPolicyException.html" title="class in org.unc.lac.baboon.exceptions">BadPolicyException</a></pre>
<div class="block">Creates the Petri Net core of the application by using the pnml file
provided as an argument, the petri net type and the transition firing
policy.
<p>
If the petri net type provided is null then
<code>PetriNetFactory.petriNetType.PLACE_TRANSITION</code> is used by default.
</p>
<p>
If the transition firing policy provided is null then
<code>FirstInLinePolicy</code> is used by default.
</p>
<p>
If pnml file path is null then <code>IllegalArgumentException</code> is
thrown.
</p></div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>A</code> - A <code>Class</code> object that extends <code>TransitionsPolicy</code>-</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>pnmlFilePath</code> - The path to the file containing the PNML (Tina dialect)
representation of the petri net.</dd>
<dd><code>type</code> - Indicates if the petri net to be created is a timed petri net
or a place-transition petri net.</dd>
<dd><code>firingPolicy</code> - A <code>Class</code> object that extends <code>TransitionsPolicy</code> used by
petri monitor to decide which transition to fire next. It might be null,
in which case <code>FirstInLinePolicy</code> will be used.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/unc/lac/baboon/exceptions/BadPolicyException.html" title="class in org.unc.lac.baboon.exceptions">BadPolicyException</a></code> - If the transitions policy provided is not correctly formed.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="initializePetriNet--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initializePetriNet</h4>
<pre>public void initializePetriNet()</pre>
<div class="block">Initializes the petri net. This method is called by Baboon framework on
its setup.</div>
</li>
</ul>
<a name="changeFiringPolicy-org.unc.lac.javapetriconcurrencymonitor.monitor.policies.TransitionsPolicy-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>changeFiringPolicy</h4>
<pre>public void changeFiringPolicy(org.unc.lac.javapetriconcurrencymonitor.monitor.policies.TransitionsPolicy firingPolicy)</pre>
<div class="block">Changes the petri monitor transition firing policy. If the policy
provided is null then no actions are taken.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>firingPolicy</code> - A <code>TransitionsPolicy</code> object used by petri monitor to
decide which transition to fire next.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>PetriMonitor</code>,
<code>PetriMonitor.setTransitionsPolicy(TransitionsPolicy)</code></dd>
</dl>
</li>
</ul>
<a name="fireTransition-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fireTransition</h4>
<pre>public void fireTransition(java.lang.String transitionName,
boolean perennialFiring)
throws java.lang.IllegalArgumentException,
org.unc.lac.javapetriconcurrencymonitor.errors.IllegalTransitionFiringError,
org.unc.lac.javapetriconcurrencymonitor.exceptions.PetriNetException</pre>
<div class="block">Fires a transition by using petri monitor. This method is called
automatically by Baboon framework and is not intended to be used by user,</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>transitionName</code> - The name of the transition to be fired.</dd>
<dd><code>perennialFiring</code> - Indicates if the firing is perennial or not.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>org.unc.lac.javapetriconcurrencymonitor.exceptions.PetriNetException</code> - If an error regarding petri nets occurs.</dd>
<dd><code>java.lang.IllegalArgumentException</code></dd>
<dd><code>org.unc.lac.javapetriconcurrencymonitor.errors.IllegalTransitionFiringError</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>PetriMonitor</code>,
<code>PetriMonitor.fireTransition(String, boolean)</code></dd>
</dl>
</li>
</ul>
<a name="setGuard-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setGuard</h4>
<pre>public void setGuard(java.lang.String guardName,
boolean newValue)
throws java.lang.IndexOutOfBoundsException,
java.lang.NullPointerException,
org.unc.lac.javapetriconcurrencymonitor.exceptions.PetriNetException</pre>
<div class="block">Sets a guard by using petri monitor. This method is called automatically
by Baboon framework and is not intended to be used by user,</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>guardName</code> - The name of the guard to be modified.</dd>
<dd><code>newValue</code> - the new boolean value to be set on the guard.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>org.unc.lac.javapetriconcurrencymonitor.exceptions.PetriNetException</code> - If an error regarding petri nets occurs.</dd>
<dd><code>java.lang.IndexOutOfBoundsException</code></dd>
<dd><code>java.lang.NullPointerException</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>PetriMonitor</code>,
<code>PetriMonitor.setGuard(String, boolean)</code></dd>
</dl>
</li>
</ul>
<a name="listenToTransitionInforms-java.lang.String-rx.Observer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>listenToTransitionInforms</h4>
<pre>public rx.Subscription listenToTransitionInforms(java.lang.String _transitionName,
rx.Observer<java.lang.String> _observer)</pre>
<div class="block">Subscribe the given observer to the given transition events if it's informed</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>_transitionName</code> - the name of the transition to subscribe to</dd>
<dd><code>_observer</code> - the observer to subscribe</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Subscription object used to unsubscribe</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the given transition is not informed</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>PetriMonitor.subscribeToTransition(String, Observer)</code></dd>
</dl>
</li>
</ul>
<a name="getMarking--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getMarking</h4>
<pre>public java.lang.Integer[] getMarking()</pre>
<div class="block">This method returns the current marking on the Petri Net core of the application</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the tokens in each place of the Petri Net</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BaboonPetriCore.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/unc/lac/baboon/petri/BaboonPetriCore.html" target="_top">Frames</a></li>
<li><a href="BaboonPetriCore.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "efb483f6e4dc1db299dd6a0bfc6d690b",
"timestamp": "",
"source": "github",
"line_count": 466,
"max_line_length": 391,
"avg_line_length": 41.16094420600859,
"alnum_prop": 0.6747302017621605,
"repo_name": "juanjoarce7456/petri_event_dispatcher",
"id": "b75755a198f4c10bdda964df785018f0db5323f7",
"size": "19181",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/org/unc/lac/baboon/petri/BaboonPetriCore.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "283214"
}
],
"symlink_target": ""
} |
#ifdef _MSC_VER
// C4503 decorated name length exceeded, name was truncated
// The only workaround is to make structs to hide the template complexity
// We don't want to have to do that
# pragma warning( disable: 4503 )
#endif
#include <gtest/gtest.h>
#define __QI_SIGNATURE_UNKNOWN_INSTEAD_OF_ASSERT
#include <qi/signature.hpp>
#include <qi/anyvalue.hpp>
#include <qi/jsoncodec.hpp>
#include <vector>
#include <map>
namespace qi
{
// OLD API compat layer for this test.
template<typename T> struct signatureFromType
{
static std::string value()
{
return typeOf<T>()->signature().toString();
}
};
struct signatureFromObject
{
template<typename T> static std::string value(const T& ptr)
{
return typeOf(ptr)->signature().toString();
}
};
}
class noSigForThis;
typedef std::map<int, int> MapInt;
TEST(TestSignature, BasicTypeSignature) {
EXPECT_EQ("b", qi::signatureFromType<bool>::value());
EXPECT_EQ("c", qi::signatureFromType<char>::value());
EXPECT_EQ("C", qi::signatureFromType<unsigned char>::value());
EXPECT_EQ("w", qi::signatureFromType<short>::value());
EXPECT_EQ("W", qi::signatureFromType<unsigned short>::value());
EXPECT_EQ("i", qi::signatureFromType<int>::value());
EXPECT_EQ("I", qi::signatureFromType<unsigned int>::value());
EXPECT_EQ("c", qi::signatureFromType<qi::int8_t>::value());
EXPECT_EQ("C", qi::signatureFromType<qi::uint8_t>::value());
EXPECT_EQ("w", qi::signatureFromType<qi::int16_t>::value());
EXPECT_EQ("W", qi::signatureFromType<qi::uint16_t>::value());
EXPECT_EQ("i", qi::signatureFromType<qi::int32_t>::value());
EXPECT_EQ("I", qi::signatureFromType<qi::uint32_t>::value());
EXPECT_EQ("l", qi::signatureFromType<qi::int64_t>::value());
EXPECT_EQ("L", qi::signatureFromType<qi::uint64_t>::value());
// long is platform-dependant and can't be tested.
EXPECT_EQ("l", qi::signatureFromType<long long>::value());
EXPECT_EQ("L", qi::signatureFromType<unsigned long long>::value());
EXPECT_EQ("f", qi::signatureFromType<float>::value());
EXPECT_EQ("d", qi::signatureFromType<double>::value());
EXPECT_EQ("s", qi::signatureFromType<std::string>::value());
EXPECT_EQ("[i]", qi::signatureFromType< std::vector<int> >::value());
EXPECT_EQ("{ii}", qi::signatureFromType< MapInt >::value() );
}
TEST(TestSignature, SignatureSize) {
qi::Signature s("(iiii)");
EXPECT_EQ(4u, s.children().size());
EXPECT_EQ(0u, s.children().at(0).children().size());
s = qi::Signature("[i]");
EXPECT_EQ(1u, s.children().size());
s = qi::Signature("{ii}");
EXPECT_EQ(2u, s.children().size());
}
TEST(TestSignature, TypeConstRefPointerMix) {
EXPECT_EQ("b", qi::signatureFromType<bool>::value());
EXPECT_EQ("c", qi::signatureFromType<char>::value());
EXPECT_EQ("i", qi::signatureFromType<int>::value());
EXPECT_EQ("f", qi::signatureFromType<float>::value());
EXPECT_EQ("d", qi::signatureFromType<double>::value());
EXPECT_EQ("s", qi::signatureFromType<std::string>::value());
EXPECT_EQ("[i]", qi::signatureFromType< std::vector<int> >::value());
EXPECT_EQ("{ii}", qi::signatureFromType< MapInt >::value() );
EXPECT_EQ("b", qi::signatureFromType<const bool>::value());
EXPECT_EQ("c", qi::signatureFromType<const char>::value());
EXPECT_EQ("i", qi::signatureFromType<const int>::value());
EXPECT_EQ("f", qi::signatureFromType<const float>::value());
EXPECT_EQ("d", qi::signatureFromType<const double>::value());
EXPECT_EQ("s", qi::signatureFromType<const std::string>::value());
EXPECT_EQ("[i]", qi::signatureFromType<const std::vector< int > >::value());
EXPECT_EQ("{ii}", qi::signatureFromType<const MapInt >::value());
EXPECT_EQ("b", qi::signatureFromType<const bool&>::value());
EXPECT_EQ("c", qi::signatureFromType<const char&>::value());
EXPECT_EQ("i", qi::signatureFromType<const int&>::value());
EXPECT_EQ("f", qi::signatureFromType<const float&>::value());
EXPECT_EQ("d", qi::signatureFromType<const double&>::value());
EXPECT_EQ("s", qi::signatureFromType<const std::string&>::value());
EXPECT_EQ("[i]", qi::signatureFromType<const std::vector< int >& >::value());
EXPECT_EQ("{ii}", qi::signatureFromType<const MapInt& >::value());
}
TEST(TestSignature, Bools) {
EXPECT_EQ("b", qi::signatureFromType<bool>::value());
EXPECT_EQ("b", qi::signatureFromType<bool&>::value());
EXPECT_EQ("b", qi::signatureFromType<const bool>::value());
EXPECT_EQ("b", qi::signatureFromType<const bool&>::value());
}
TEST(TestSignature, Strings) {
EXPECT_EQ("s", qi::signatureFromType<std::string>::value());
EXPECT_EQ("s", qi::signatureFromType<const std::string>::value());
EXPECT_EQ("s", qi::signatureFromType<char *>::value());
EXPECT_EQ("s", qi::signatureFromType<const char *>::value());
EXPECT_EQ("s", qi::signatureFromType<const char * const>::value());
EXPECT_EQ("s", qi::signatureFromType<char const * const>::value());
EXPECT_EQ("s", qi::signatureFromType<char *&>::value());
EXPECT_EQ("s", qi::signatureFromType<const char *&>::value());
EXPECT_EQ("s", qi::signatureFromType<const char * const&>::value());
EXPECT_EQ("s", qi::signatureFromType<char const * const&>::value());
}
TEST(TestSignature, VArgs) {
EXPECT_EQ("#m", qi::signatureFromType<qi::AnyVarArguments>::value());
//vargs
EXPECT_TRUE(qi::Signature("#b").isValid());
EXPECT_TRUE(qi::Signature("#b<titi,toto>").isValid());
//kwargs
EXPECT_TRUE(qi::Signature("~b").isValid());
EXPECT_TRUE(qi::Signature("~b<titi,toto>").isValid());
}
struct MPoint {
MPoint(int x=0, int y=0)
: x(x)
, y(y)
{}
int x;
int y;
};
QI_TYPE_STRUCT(MPoint, x, y);
TEST(TestSignature, NamedTuple) {
EXPECT_EQ("(ii)<MPoint,x,y>", qi::typeOf<MPoint>()->signature().toString());
}
TEST(TestSignature, ComplexTypeSignature) {
//{ii}
typedef std::map<int,int> MapInt;
//{{ii}{ii}}
typedef std::map<MapInt,MapInt> MapInt2;
typedef std::vector<MapInt2> VectorMapInt2;
// MapInt2& Does not works
typedef MapInt2 MapInt2Ref;
typedef std::vector<MapInt2Ref> VectMapInt2Ref;
//const VectMapInt2Ref does not works
typedef VectMapInt2Ref VectMapInt2RefConst;
typedef std::vector< VectMapInt2RefConst > VectVectMapInt2ConstRef;
typedef std::map<VectorMapInt2, VectVectMapInt2ConstRef> FuckinMap;
//{[{{ii}{ii}}][[{{ii}{ii}}&]#]}
//and obama said: Yes We Can!
EXPECT_EQ("{ii}" , qi::typeOf<MapInt>()->signature().toString());
EXPECT_EQ("{{ii}{ii}}" , qi::typeOf<MapInt2>()->signature().toString());
EXPECT_EQ("[{{ii}{ii}}]" , qi::typeOf<VectorMapInt2>()->signature().toString());
EXPECT_EQ("{{ii}{ii}}" , qi::typeOf<MapInt2Ref>()->signature().toString());
EXPECT_EQ("[{{ii}{ii}}]" , qi::typeOf<VectMapInt2Ref>()->signature().toString());
EXPECT_EQ("[{{ii}{ii}}]" , qi::typeOf<VectMapInt2RefConst>()->signature().toString());
EXPECT_EQ("[[{{ii}{ii}}]]" , qi::typeOf<VectVectMapInt2ConstRef>()->signature().toString());
EXPECT_EQ("{[{{ii}{ii}}][[{{ii}{ii}}]]}", qi::typeOf<FuckinMap>()->signature().toString());
}
TEST(TestSignature, FromObject) {
int myint = 42;
EXPECT_EQ("i", qi::signatureFromObject::value(myint));
}
TEST(TestSignature, ComplexConstRefPtr) {
EXPECT_EQ("f", qi::signatureFromType<float>::value());
EXPECT_EQ("f", qi::signatureFromType<float&>::value());
EXPECT_EQ("f", qi::signatureFromType<const float &>::value());
EXPECT_EQ("f", qi::signatureFromType<const float>::value());
}
TEST(TestSignature, Equal) {
EXPECT_EQ(qi::signatureFromType<float&>::value(), qi::signatureFromType<float>::value());
EXPECT_TRUE(qi::Signature("[s]") == qi::Signature("[s]"));
EXPECT_TRUE(qi::Signature("(ss)<Point,x,y>") == qi::Signature("(ss)")); // really?
EXPECT_TRUE(qi::Signature("(mm)") != "(mmm)");
EXPECT_TRUE(qi::Signature("(mm)") != "(m)");
}
TEST(TestSignature, InvalidSignature) {
//empty signature are invalid
EXPECT_THROW(qi::Signature(""), std::runtime_error);
EXPECT_THROW(qi::Signature("("), std::runtime_error);
EXPECT_THROW(qi::Signature("{"), std::runtime_error);
EXPECT_THROW(qi::Signature("["), std::runtime_error);
EXPECT_THROW(qi::Signature("plafbim"), std::runtime_error);
EXPECT_THROW(qi::Signature("(m)(sib)"), std::runtime_error);
EXPECT_THROW(qi::Signature("ddd"), std::runtime_error);
EXPECT_THROW(qi::Signature("(mm"), std::runtime_error);
}
TEST(TestSignature, InvalidNumberOfArgs) {
//empty signature are invalid
EXPECT_THROW(qi::Signature("[iii]"), std::runtime_error);
EXPECT_THROW(qi::Signature("{iii}"), std::runtime_error);
EXPECT_THROW(qi::Signature("{i}"), std::runtime_error);
}
TEST(TestSignature, FromString) {
qi::Signature *sig;
sig = new qi::Signature();
EXPECT_FALSE(sig->isValid());
delete sig;
sig = new qi::Signature("(s)");
EXPECT_TRUE(sig->isValid());
delete sig;
sig = new qi::Signature("()");
EXPECT_TRUE(sig->isValid());
delete sig;
sig = new qi::Signature("()<>");
EXPECT_TRUE(sig->isValid());
delete sig;
ASSERT_NO_THROW(sig = new qi::Signature("(((sIsI[(sssW)]s)))"));
EXPECT_TRUE(sig->isValid());
delete sig;
ASSERT_NO_THROW(sig = new qi::Signature("({I(Isss[(ss)]s)}{I(Is)}{I(Iss)}s)"));
EXPECT_TRUE(sig->isValid());
delete sig;
}
TEST(TestSignature, SignatureSplitError) {
std::vector<std::string> sigInfo;
sigInfo = qi::signatureSplit("reply");
EXPECT_EQ("", sigInfo[0]);
EXPECT_EQ("reply", sigInfo[1]);
EXPECT_EQ("", sigInfo[2]);
EXPECT_ANY_THROW(qi::signatureSplit("reply::"));
EXPECT_ANY_THROW(qi::signatureSplit("reply::("));
EXPECT_ANY_THROW(qi::signatureSplit("reply::e"));
EXPECT_ANY_THROW(qi::signatureSplit("reply::(RRRR)"));
EXPECT_NO_THROW(qi::signatureSplit("reply::(sssss)"));
EXPECT_ANY_THROW(qi::signatureSplit("reply::([sss])"));
EXPECT_NO_THROW(qi::signatureSplit("reply::([s])"));
EXPECT_ANY_THROW(qi::signatureSplit("titi::s([[xxx]])"));
EXPECT_ANY_THROW(qi::signatureSplit("titi::s([[sss]])"));
EXPECT_NO_THROW(qi::signatureSplit("titi::s([[s]])"));
EXPECT_ANY_THROW(qi::signatureSplit("titi::s([({ii}s[ss])])"));
EXPECT_NO_THROW(qi::signatureSplit("titi::s([({ii}s[s])])"));
EXPECT_NO_THROW(qi::signatureSplit("titi::s({i{is}})"));
}
TEST(TestSignature, IsCompatible) {
qi::Signature s("(s[m])");
EXPECT_EQ(s.isConvertibleTo("(si)"), 0.);
EXPECT_EQ(s.isConvertibleTo("(sf)"), 0.);
EXPECT_EQ(s.isConvertibleTo("(ss)"), 0.);
EXPECT_GT(s.isConvertibleTo("(sm)"), 0.);
qi::Signature s2("(s)");
EXPECT_EQ(s2.isConvertibleTo("(si)"), 0.);
EXPECT_GT(s2.isConvertibleTo("(m)"), 0.);
qi::Signature s3("([s])");
EXPECT_GT(s3.isConvertibleTo("([m])"), s3.isConvertibleTo("(m)"));
}
TEST(TestSignature, SignatureSplit) {
std::vector<std::string> sigInfo;
ASSERT_NO_THROW(sigInfo = qi::signatureSplit("reply::(s)"));
EXPECT_EQ("", sigInfo[0]);
EXPECT_EQ("reply", sigInfo[1]);
EXPECT_EQ("(s)", sigInfo[2]);
ASSERT_NO_THROW(sigInfo = qi::signatureSplit("reply::s(s)"));
EXPECT_EQ("s", sigInfo[0]);
EXPECT_EQ("reply", sigInfo[1]);
EXPECT_EQ("(s)", sigInfo[2]);
ASSERT_NO_THROW(sigInfo = qi::signatureSplit("info::(m)(sib)"));
EXPECT_EQ("(m)", sigInfo[0]);
EXPECT_EQ("info", sigInfo[1]);
EXPECT_EQ("(sib)", sigInfo[2]);
ASSERT_NO_THROW(sigInfo = qi::signatureSplit("toto::((([{ii}])))({[{{ii}{ii}}][[{{ii}{ii}}]]})"));
EXPECT_EQ("((([{ii}])))", sigInfo[0]);
EXPECT_EQ("toto", sigInfo[1]);
EXPECT_EQ("({[{{ii}{ii}}][[{{ii}{ii}}]]})", sigInfo[2]);
ASSERT_NO_THROW(sigInfo = qi::signatureSplit("toto"));
EXPECT_EQ("", sigInfo[0]);
EXPECT_EQ("toto", sigInfo[1]);
EXPECT_EQ("", sigInfo[2]);
}
TEST(TestSignature, ItAnnotation) {
std::string orig("((m)<Plouf,x>(scf)<Point3d,x,y,z>)");
qi::Signature sig(orig);
qi::SignatureVector subsig = sig.children();
EXPECT_EQ(orig, sig.toString());
EXPECT_EQ("(m)<Plouf,x>", subsig[0].toString());
EXPECT_EQ("(scf)<Point3d,x,y,z>", subsig[1].toString());
}
TEST(TestSignature, TestToSTLType)
{
qi::Signature sig("(s)");
EXPECT_EQ("(String)", sig.toPrettySignature());
qi::Signature sig2("(slb)");
EXPECT_EQ("(String,Int64,Bool)", sig2.toPrettySignature());
qi::Signature sig3("{is}");
EXPECT_EQ("Map<Int32,String>", sig3.toPrettySignature());
qi::Signature sig4("((m)(scf))");
EXPECT_EQ("((Value),(String,Int8,Float))", sig4.toPrettySignature());
qi::Signature sig5("((m)<Plouf,x>(scf)<Point3d,x,y,z>)");
EXPECT_EQ("(Plouf,Point3d)", sig5.toPrettySignature());
}
//expect that the following test to do not build. (static assert)
static int gGlobalResult = 0;
void vfun0() { gGlobalResult = 0; }
void vfun1(const int &p0) { gGlobalResult = p0; }
void vfun2(const int &p0,const int &p1) { gGlobalResult = p0 + p1; }
void vfun3(const int &p0,const int &p1,const int &p2) { gGlobalResult = p0 + p1 + p2; }
void vfun4(const int &p0,const int &p1,const int &p2,const int &p3) { gGlobalResult = p0 + p1 + p2 + p3; }
void vfun5(const int &p0,const int &p1,const int &p2,const int &p3,const int &p4) { gGlobalResult = p0 + p1 + p2 + p3 + p4; }
void vfun6(const int &p0,const int &p1,const int &p2,const int &p3,const int &p4,const int &p5) { gGlobalResult = p0 + p1 + p2 + p3 + p4 + p5; }
int fun0() { return 0; }
int fun1(const int &p0) { return p0; }
int fun2(const int &p0,const int &p1) { return p0 + p1; }
int fun3(const int &p0,const int &p1,const int &p2) { return p0 + p1 + p2; }
int fun4(const int &p0,const int &p1,const int &p2,const int &p3) { return p0 + p1 + p2 + p3; }
int fun5(const int &p0,const int &p1,const int &p2,const int &p3,const int &p4) { return p0 + p1 + p2 + p3 + p4; }
int fun6(const int &p0,const int &p1,const int &p2,const int &p3,const int &p4,const int &p5) { return p0 + p1 + p2 + p3 + p4 + p5; }
struct Foo {
void voidCall() { return; }
int intStringCall(const std::string &plouf) { return plouf.size(); }
int fun0() { return 0; }
int fun1(const int &p0) { return p0; }
int fun2(const int &p0,const int &p1) { return p0 + p1; }
int fun3(const int &p0,const int &p1,const int &p2) { return p0 + p1 + p2; }
int fun4(const int &p0,const int &p1,const int &p2,const int &p3) { return p0 + p1 + p2 + p3; }
int fun5(const int &p0,const int &p1,const int &p2,const int &p3,const int &p4) { return p0 + p1 + p2 + p3 + p4; }
int fun6(const int &p0,const int &p1,const int &p2,const int &p3,const int &p4,const int &p5) { return p0 + p1 + p2 + p3 + p4 + p5; }
void vfun0() { gGlobalResult = 0; }
void vfun1(const int &p0) { gGlobalResult = p0; }
void vfun2(const int &p0,const int &p1) { gGlobalResult = p0 + p1; }
void vfun3(const int &p0,const int &p1,const int &p2) { gGlobalResult = p0 + p1 + p2; }
void vfun4(const int &p0,const int &p1,const int &p2,const int &p3) { gGlobalResult = p0 + p1 + p2 + p3; }
void vfun5(const int &p0,const int &p1,const int &p2,const int &p3,const int &p4) { gGlobalResult = p0 + p1 + p2 + p3 + p4; }
void vfun6(const int &p0,const int &p1,const int &p2,const int &p3,const int &p4,const int &p5) { gGlobalResult = p0 + p1 + p2 + p3 + p4 + p5; }
};
TEST(TestSignature, WeirdPointerTypes) {
EXPECT_EQ("X", qi::signatureFromType<bool*>::value());
EXPECT_EQ("X", qi::signatureFromType<bool*&>::value());
EXPECT_EQ("X", qi::signatureFromType<const bool*>::value());
EXPECT_EQ("X", qi::signatureFromType<const bool*&>::value());
EXPECT_EQ("X", qi::signatureFromType<float *>::value());
EXPECT_EQ("X", qi::signatureFromType<float const *>::value());
EXPECT_EQ("X", qi::signatureFromType<float * const>::value());
EXPECT_EQ("X", qi::signatureFromType<float const * const>::value());
}
//not instanciable
//TEST(TestSignature, noSignature) {
// EXPECT_EQ("X", qi::signatureFromType<noSigForThis>::value());
// EXPECT_EQ("X", qi::signatureFromType<void (int, int)>::value());
//}
TEST(TestSignature, WeirdBasicFunctionSignature) {
EXPECT_EQ("X", qi::signatureFromObject::value(&fun0));
EXPECT_EQ("X", qi::signatureFromObject::value(&fun1));
EXPECT_EQ("X", qi::signatureFromObject::value(&fun2));
EXPECT_EQ("X", qi::signatureFromObject::value(&fun3));
EXPECT_EQ("X", qi::signatureFromObject::value(&fun4));
EXPECT_EQ("X", qi::signatureFromObject::value(&fun5));
EXPECT_EQ("X", qi::signatureFromObject::value(&fun6));
EXPECT_EQ("X", qi::signatureFromObject::value(fun0));
EXPECT_EQ("X", qi::signatureFromObject::value(fun1));
EXPECT_EQ("X", qi::signatureFromObject::value(fun2));
EXPECT_EQ("X", qi::signatureFromObject::value(fun3));
EXPECT_EQ("X", qi::signatureFromObject::value(fun4));
EXPECT_EQ("X", qi::signatureFromObject::value(fun5));
EXPECT_EQ("X", qi::signatureFromObject::value(fun6));
}
TEST(TestSignature, WeirdPointers) {
EXPECT_EQ("X", qi::signatureFromType<const bool*>::value());
EXPECT_EQ("X", qi::signatureFromType<const int*>::value());
EXPECT_EQ("X", qi::signatureFromType<const float*>::value());
EXPECT_EQ("X", qi::signatureFromType<const double*>::value());
EXPECT_EQ("X", qi::signatureFromType<const std::string*>::value());
EXPECT_EQ("X", qi::signatureFromType<const std::vector< int >* >::value());
EXPECT_EQ("X", qi::signatureFromType<const MapInt* >::value());
EXPECT_EQ("X", qi::signatureFromType<const bool*&>::value());
EXPECT_EQ("X", qi::signatureFromType<const int*&>::value());
EXPECT_EQ("X", qi::signatureFromType<const float*&>::value());
EXPECT_EQ("X", qi::signatureFromType<const double*&>::value());
EXPECT_EQ("X", qi::signatureFromType<const std::string*&>::value());
EXPECT_EQ("X", qi::signatureFromType<const std::vector< int >*& >::value());
EXPECT_EQ("X", qi::signatureFromType<const MapInt*& >::value());
}
TEST(TestSignature, FunctionType) {
EXPECT_EQ("X", qi::signatureFromType<void (*)(int, int)>::value());
}
TEST(TestSignature, BasicVoidFunctionSignature) {
EXPECT_EQ("X", qi::signatureFromObject::value(&vfun0));
EXPECT_EQ("X", qi::signatureFromObject::value(&vfun1));
EXPECT_EQ("X", qi::signatureFromObject::value(&vfun2));
EXPECT_EQ("X", qi::signatureFromObject::value(&vfun3));
EXPECT_EQ("X", qi::signatureFromObject::value(&vfun4));
EXPECT_EQ("X", qi::signatureFromObject::value(&vfun5));
EXPECT_EQ("X", qi::signatureFromObject::value(&vfun6));
EXPECT_EQ("X", qi::signatureFromObject::value(vfun0));
EXPECT_EQ("X", qi::signatureFromObject::value(vfun1));
EXPECT_EQ("X", qi::signatureFromObject::value(vfun2));
EXPECT_EQ("X", qi::signatureFromObject::value(vfun3));
EXPECT_EQ("X", qi::signatureFromObject::value(vfun4));
EXPECT_EQ("X", qi::signatureFromObject::value(vfun5));
EXPECT_EQ("X", qi::signatureFromObject::value(vfun6));
}
//dont ask me why, but member function evaluates to bool :(
TEST(TestSignature, WeirdBasicVoidMemberSignature) {
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::vfun0));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::vfun1));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::vfun2));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::vfun3));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::vfun4));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::vfun5));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::vfun6));
}
TEST(TestSignature, WeirdBasicMemberSignature) {
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::fun0));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::fun1));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::fun2));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::fun3));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::fun4));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::fun5));
EXPECT_EQ("X", qi::signatureFromObject::value(&Foo::fun6));
}
//yes shared_ptr evaluate to bool
TEST(TestSignature, WeirdSharedPtr) {
EXPECT_EQ("X", qi::signatureFromType< boost::shared_ptr<int> >::value());
EXPECT_EQ("X", qi::signatureFromType< boost::shared_ptr<int> &>::value());
}
qiLogCategory("test.signature()");
void stackIt(std::vector<qi::Signature>& stack, const qi::Signature& sig) {
qiLogInfo() << "Pushing:" << sig.toString() << ", annot:" << sig.annotation();
qi::SignatureVector child = sig.children();
for (qi::SignatureVector::const_reverse_iterator it = child.rbegin(); it != child.rend(); ++it) {
stackIt(stack, *it);
}
stack.push_back(sig);
}
class SignatureValidator
{
public:
SignatureValidator(qi::Signature s)
: good(true), count(0)
{
stackIt(stack, s);
}
SignatureValidator& operator()(char t, const char* annotation)
{
if (!good)
return *this;
if (stack.empty())
{
qiLogError() << "No more elements after " << count;
good = false;
return *this;
}
qi::Signature& schi = stack.back();
if (schi.type() != t)
{
qiLogError() << "Type mismatch " << t << " " << schi.type();
good = false;
return *this;
}
if (schi.annotation() != annotation)
{
qiLogError() << "Annotation mismatch " << annotation << " vs " << schi.annotation();
good = false;
return *this;
}
stack.pop_back();
return *this;
}
operator bool() const
{
if (!stack.empty())
{
qiLogError() << "Remaining elements at the end";
good = false;
}
return good;
}
std::vector<qi::Signature> stack;
mutable bool good;
int count;
};
qi::Signature tuple(const std::string& str)
{
return qi::Signature("(" + str + ")");
}
TEST(TestSignature, Annotation) {
using qi::Signature;
Signature s("i<foo>");
EXPECT_EQ("foo", s.annotation());
EXPECT_EQ('i', s.type());
s = Signature("i<foo<bar><<baz@5'\"[]><>a>>");
EXPECT_EQ('i', s.type());
EXPECT_EQ("foo<bar><<baz@5'\"[]><>a>", s.annotation());
s = Signature("(ii<foo>i<bar>ii<bam<baz>>)");
qiLogInfo() << "sig: " << s.toString();
EXPECT_EQ(5u, s.children().size());
EXPECT_TRUE(
SignatureValidator(s)
('(', "")
('i', "")
('i', "foo")
('i', "bar")
('i', "")
('i', "bam<baz>")
);
EXPECT_TRUE(SignatureValidator(tuple("i<foo>[i<bar>]<baz>{i<bim>I<bam>}<boum>(i<pif>I<paf>)<pouf>"))
('(', "")
('i', "foo")
('[', "baz")
('i', "bar")
('{', "boum")
('i', "bim")
('I', "bam")
('(', "pouf")
('i', "pif")
('I', "paf")
);
EXPECT_TRUE(SignatureValidator("[[[[i<a>]<b>]<c>]<d>]<e>")
('[', "e")
('[', "d")
('[', "c")
('[', "b")
('i', "a")
);
// Test the test-suite tool
EXPECT_FALSE(SignatureValidator("i")('I', ""));
EXPECT_FALSE(SignatureValidator("i"));
EXPECT_FALSE(SignatureValidator(tuple("ii"))('i', ""));
EXPECT_FALSE(SignatureValidator("i")('i', "coin"));
EXPECT_FALSE(SignatureValidator("i<coin>")('i', ""));
}
TEST(TestSignature, AnnotationInvalid) {
using qi::Signature;
EXPECT_THROW(Signature("i<foo") , std::runtime_error);
EXPECT_THROW(Signature("ifoo>") , std::runtime_error);
EXPECT_THROW(Signature("[ifoo>]"), std::runtime_error);
EXPECT_THROW(Signature("[i]>") , std::runtime_error);
EXPECT_THROW(Signature("<>") , std::runtime_error);
EXPECT_THROW(Signature(">") , std::runtime_error);
EXPECT_THROW(Signature("<") , std::runtime_error);
}
struct Point
{
double x;
double y;
std::string name;
};
QI_TYPE_STRUCT(Point, x, y, name);
TEST(TestSignature, AnnotationStruct)
{
EXPECT_EQ("(dds)<Point,x,y,name>", qi::typeOf<Point>()->signature().toString());
}
std::string trimall(const std::string& s)
{
std::string res;
for (unsigned i=0; i<s.size(); ++i)
if (s[i] != ' ')
res += s[i];
return res;
}
std::string unarmor(const std::string& s)
{
return trimall(s.substr(1, s.size()-2));
}
TEST(TestSignature, ToData)
{
#define j(a) trimall(qi::encodeJSON(qi::Signature(a).toData()))
#define S(a) unarmor(#a)
EXPECT_EQ(j("i"), S(([ "i", [], "" ])));
EXPECT_EQ(j("i<foo>"), S(([ "i", [], "foo" ])));
EXPECT_EQ(j("[i<foo>]<bar>"), S((["[", [[ "i", [], "foo" ]], "bar"])));
EXPECT_EQ(j("(i[f]{if})"),
S(( ["(", [["i", [], ""],["[", [["f", [], ""]], ""],["{", [["i", [], ""], ["f", [], ""]], "" ]], "" ])));
}
#define verif_iter(_it, _sig, _type, _hasChildren) \
{\
EXPECT_STREQ(_sig, (_it).toString().c_str());\
EXPECT_TRUE(_hasChildren == (_it).hasChildren()); \
EXPECT_EQ(qi::Signature::_type, (_it).type());\
}
TEST(TestSignatureIterator, Simple) {
qi::SignatureVector::iterator it;
qi::Signature signature("(is)");
qi::SignatureVector sig = signature.children();
EXPECT_TRUE(signature.isValid());
EXPECT_TRUE(sig.size() == 2);
it = sig.begin();
verif_iter(*it, "i", Type_Int32, false);
++it;
verif_iter(*it, "s", Type_String, false);
}
TEST(TestSignatureIterator, Empty) {
qi::Signature sig3;
EXPECT_TRUE(sig3.children().size() == 0);
verif_iter(sig3, "", Type_None, false);
EXPECT_STREQ("", sig3.toString().c_str());
}
//#endif
| {
"content_hash": "cb7c0ed38bdc0a7f1587720b1dc5e0fd",
"timestamp": "",
"source": "github",
"line_count": 711,
"max_line_length": 148,
"avg_line_length": 37.08579465541491,
"alnum_prop": 0.5951152912621359,
"repo_name": "vbarbaresi/libqi",
"id": "82af91c55266821e6ee704e80c02776dc080471e",
"size": "26495",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/type/test_signature.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C++",
"bytes": "2153872"
},
{
"name": "CMake",
"bytes": "32455"
}
],
"symlink_target": ""
} |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="br.com.geconp.geconp.DespesaActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/valor"
android:id="@+id/textView6"
android:textColor="@android:color/black"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editTextValorDespesa"
android:text=".00"
android:inputType="phone"
android:numeric="decimal"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/data"
android:id="@+id/textView7"
android:textColor="@android:color/black"/>
<EditText
android:layout_width="@dimen/width_edit_text"
android:layout_height="wrap_content"
android:inputType="date"
android:maxLength="15"
android:ems="10"
android:id="@+id/editTextDataDespesa" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/descricao"
android:id="@+id/textView8"
android:textColor="@android:color/black"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editTextDescricaoDespesa"
android:inputType="text"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tipo"
android:id="@+id/textView9"
android:textColor="@android:color/black"/>
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/spinnerTipoDespesa" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/conta"
android:id="@+id/textView10"
android:textColor="@android:color/black"/>
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/spinnerContaDespesa" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/adicionar"
android:id="@+id/buttonAddDespesa"
android:background="#ff3e2aff"
android:textColor="#ffffffff"
android:layout_marginTop="20dp"
android:width="@dimen/largura" />
</LinearLayout>
</LinearLayout>
| {
"content_hash": "a7f7eb0a7e5fa74c88371049d568091b",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 96,
"avg_line_length": 35.28260869565217,
"alnum_prop": 0.6410967344423907,
"repo_name": "marcio0493/Geconp",
"id": "2eabdab1bcf252654e86efec1d990e1caef726a6",
"size": "3246",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/activity_despesa.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "263237"
}
],
"symlink_target": ""
} |
{% extends "layout/default.html" %}
{% set active_page = 'events' %}
{% block title %}
Events{{ super() }}
{% endblock %}
{% block main_body %}
<div class="row">
<!-- Blog Entries Column -->
<div class="col-md-8">
<h2 class="ppage-header">
Upcoming events and presentations
</h2>
<ul>
<li>
26 October 2016, "Speech presentation in 19th century literature: A hands-on approach" as part of the CCR Corpus Training Sessions, Johan de Joode
</li>
<li>
1 November 2016, Michaela Mahlberg will deliver <a href="https://cardiffdigitalnetwork.org/2016/09/07/cfp-word-image-digital/"/>a keynote</a> at the Cardiff Digital Cultures Network
</li>
<li>
30 November 2016, "Discourse and dialogue: Annotating and aggregating corpus data" as part of the CCR Corpus Training Sessions, Johan de Joode
</li>
</ul>
<h2 class="ppage-header">
Past events and presentations
</h2>
<ul>
<li>
16-18 September 2016, Michaela Mahlberg gave a keynote at the <a href="https://apling.engl.iastate.edu/conferences/aacl2016/"> American Association for Corpus Linguistics (AACL) Conference</a>
</li>
<li>
4 July 2016, CLiC Workshop at University of Kent
</li>
<li>
20-24 June 2016 <a href="http://www.birmingham.ac.uk/research/activity/corpus/events/2016/corpus-linguistics-summer-school.aspx">Corpus Linguistics Summer School at CCR</a>
</li>
<li>
20 June 2016 Michaela Mahlberg delivers 11th Annual Sinclair Lecture:
You can watch a video of the lecture <a href="http://www.birmingham.ac.uk/research/activity/corpus/news/2016/sinclair-lecture-2016.aspx">here</a>.
</li>
<li>
4 June 2016 - Hay Festival, University of Birmingham series, <a href="https://www.hayfestival.com/p-11096-john-holmes-michaela-mahlberg-will-tattersdill.aspx">‘Hot off the press’</a> John Holmes, Michaela Mahlberg and Will Tattersdill
</li>
<li>
14 March 2016, CLiC Workshop for the Schools Partnership Gateway, ‘Corpus Stylistics for the English Classroom’, University of Nottingham
</li>
<li>
16 November 2015, CLiC Workshop hosted jointly organised the CCR and AQA, ‘Corpus Stylistics for A-level Teachers’ – see <a href="https://thedefinitearticle.aqa.org.uk/2016/01/25/corpus-stylistics-workshop-for-a-level-teachers/">here</a> for a review </li>
<!-- <li>16 November 2015: <a href="http://www.aqa.org.uk/professional-development/course-details?meta_E=SENGAlevelEnglishWorkshopCorpuslinguisticmethods" class="sys_16">Using corpus linguistic methods in the classroom: A one-day workshop for A level teachers</a></li> -->
<li>12 November 2015, <a title="Advanced CLiC - User-defined annotation" href="http://birmingham.ac.uk/schools/edacs/departments/englishlanguage/events/2015/de-joode-advanced-corpus-workshop.aspx" class="sys_0 sys_t1491559">Advanced CLiC – User-defined annotation</a>, Centre for Advanced Research in English, Johan de Joode</li>
<li>29 October 2015, <a title="Using CLiC to study literature" href="http://birmingham.ac.uk/schools/edacs/departments/englishlanguage/events/2015/de-joode-corpus-workshop.aspx" class="sys_0 sys_t1491559">Using CLiC to study literature</a>, Centre for Advanced Research in English, Johan de Joode</li>
</ul>
</div>
<!-- Blog Sidebar Widgets Column -->
{% include "blocks/twitter.html" %}
</div>
<!-- Footer -->
{% endblock %}
{% block scripts %}
{{ super() }}
{% endblock %}
| {
"content_hash": "4baf795a29d4274669b66ab122d60d6f",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 338,
"avg_line_length": 42.1219512195122,
"alnum_prop": 0.7101910828025477,
"repo_name": "CentreForResearchInAppliedLinguistics/clic",
"id": "f2649ac96c137a2a0cc22fe60062fad25e754fa2",
"size": "3468",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "clic/web/templates/info/events.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4449"
},
{
"name": "HTML",
"bytes": "167472"
},
{
"name": "JavaScript",
"bytes": "45975"
},
{
"name": "Mako",
"bytes": "412"
},
{
"name": "Python",
"bytes": "144586"
},
{
"name": "XSLT",
"bytes": "12605"
}
],
"symlink_target": ""
} |
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define, $, window, brackets, Mustache */
define(function (require, exports, module) {
"use strict";
// Load dependent modules
var Menus = require("command/Menus"),
StringUtils = require("utils/StringUtils"),
PopUpManager = require("widgets/PopUpManager"),
ViewUtils = require("utils/ViewUtils"),
KeyBindingManager = require("command/KeyBindingManager"),
KeyEvent = require("utils/KeyEvent");
var CodeHintListHTML = require("text!htmlContent/code-hint-list.html");
/**
* Displays a popup list of hints for a given editor context.
*
* @constructor
* @param {Editor} editor
*/
function CodeHintList(editor) {
/**
* The list of hints to display
*
* @type {Array.<string|jQueryObject>}
*/
this.hints = [];
/**
* The selected position in the list; otherwise -1.
*
* @type {number}
*/
this.selectedIndex = -1;
/**
* The maximum number of hints to display
*
* @type {number}
*/
this.maxResults = 999;
/**
* Is the list currently open?
*
* @type {boolean}
*/
this.opened = false;
/**
* The editor context
*
* @type {Editor}
*/
this.editor = editor;
/**
* The hint selection callback function
*
* @type {Function}
*/
this.handleSelect = null;
/**
* The hint list closure callback function
*
* @type {Function}
*/
this.handleClose = null;
/**
* The hint list menu object
*
* @type {jQuery.Object}
*/
this.$hintMenu =
$("<li class='dropdown codehint-menu'></li>")
.append($("<a href='#' class='dropdown-toggle' data-toggle='dropdown'></a>")
.hide())
.append("<ul class='dropdown-menu'></ul>");
this._keydownHook = this._keydownHook.bind(this);
}
/**
* Select the item in the hint list at the specified index, or remove the
* selection if index < 0.
*
* @private
* @param {number} index
*/
CodeHintList.prototype._setSelectedIndex = function (index) {
var items = this.$hintMenu.find("li");
// Range check
index = Math.max(-1, Math.min(index, items.length - 1));
// Clear old highlight
if (this.selectedIndex !== -1) {
$(items[this.selectedIndex]).find("a").removeClass("highlight");
}
this.selectedIndex = index;
// Highlight the new selected item, if necessary
if (this.selectedIndex !== -1) {
var $item = $(items[this.selectedIndex]);
var $view = this.$hintMenu.find("ul.dropdown-menu");
ViewUtils.scrollElementIntoView($view, $item, false);
$item.find("a").addClass("highlight");
}
};
/**
* Rebuilds the list items for the hint list.
*
* @private
*/
CodeHintList.prototype._buildListView = function (hintObj) {
var self = this,
match = hintObj.match,
selectInitial = hintObj.selectInitial,
view = { hints: [] },
_addHint;
this.hints = hintObj.hints;
this.hints.handleWideResults = hintObj.handleWideResults;
// if there is no match, assume name is already a formatted jQuery
// object; otherwise, use match to format name for display.
if (match) {
_addHint = function (name) {
var displayName = name.replace(
new RegExp(StringUtils.regexEscape(match), "i"),
"<strong>$&</strong>"
);
view.hints.push({ formattedHint: "<span>" + displayName + "</span>" });
};
} else {
_addHint = function (hint) {
view.hints.push({ formattedHint: (hint instanceof $) ? "" : hint });
};
}
// clear the list
this.$hintMenu.find("li").remove();
// if there are no hints then close the list; otherwise add them and
// set the selection
if (this.hints.length === 0) {
if (this.handleClose) {
this.handleClose();
}
} else {
this.hints.some(function (item, index) {
if (index > self.maxResults) {
return true;
}
_addHint(item);
});
// render code hint list
var $ul = this.$hintMenu.find("ul.dropdown-menu"),
$parent = $ul.parent();
// remove list temporarily to save rendering time
$ul.remove().append(Mustache.render(CodeHintListHTML, view));
$ul.children("li").each(function (index, element) {
var hint = self.hints[index],
$element = $(element);
// store hint on each list item
$element.data("hint", hint);
// insert jQuery hint objects after the template is rendered
if (hint instanceof $) {
$element.find(".codehint-item").append(hint);
}
});
// delegate list item events to the top-level ul list element
$ul.on("click", "li", function (e) {
// Don't let the click propagate upward (otherwise it will
// hit the close handler in bootstrap-dropdown).
e.stopPropagation();
if (self.handleSelect) {
self.handleSelect($(this).data("hint"));
}
});
// Lists with wide results require different formatting
if (this.hints.handleWideResults) {
$ul.find("li a").addClass("wide-result");
}
// attach to DOM
$parent.append($ul);
this._setSelectedIndex(selectInitial ? 0 : -1);
}
};
/**
* Computes top left location for hint list so that the list is not clipped by the window.
* Also computes the largest available width.
*
* @private
* @return {{left: number, top: number, width: number}}
*/
CodeHintList.prototype._calcHintListLocation = function () {
var cursor = this.editor._codeMirror.cursorCoords(),
posTop = cursor.bottom,
posLeft = cursor.left,
textHeight = this.editor.getTextHeight(),
$window = $(window),
$menuWindow = this.$hintMenu.children("ul"),
menuHeight = $menuWindow.outerHeight();
// TODO Ty: factor out menu repositioning logic so code hints and Context menus share code
// adjust positioning so menu is not clipped off bottom or right
var bottomOverhang = posTop + menuHeight - $window.height();
if (bottomOverhang > 0) {
posTop -= (textHeight + 2 + menuHeight);
}
posTop -= 30; // shift top for hidden parent element
var menuWidth = $menuWindow.width();
var availableWidth = menuWidth;
var rightOverhang = posLeft + menuWidth - $window.width();
if (rightOverhang > 0) {
posLeft = Math.max(0, posLeft - rightOverhang);
} else if (this.hints.handleWideResults) {
// Right overhang is negative
availableWidth = menuWidth + Math.abs(rightOverhang);
}
return {left: posLeft, top: posTop, width: availableWidth};
};
/**
* Check whether keyCode is one of the keys that we handle or not.
*
* @param {number} keyCode
*/
CodeHintList.prototype.isHandlingKeyCode = function (keyCode) {
return (keyCode === KeyEvent.DOM_VK_UP || keyCode === KeyEvent.DOM_VK_DOWN ||
keyCode === KeyEvent.DOM_VK_PAGE_UP || keyCode === KeyEvent.DOM_VK_PAGE_DOWN ||
keyCode === KeyEvent.DOM_VK_RETURN || keyCode === KeyEvent.DOM_VK_TAB);
};
/**
* Convert keydown events into hint list navigation actions.
*
* @param {KeyBoardEvent} keyEvent
*/
CodeHintList.prototype._keydownHook = function (event) {
var keyCode,
self = this;
// positive distance rotates down; negative distance rotates up
function _rotateSelection(distance) {
var len = Math.min(self.hints.length, self.maxResults),
pos;
if (self.selectedIndex < 0) {
// set the initial selection
pos = (distance > 0) ? distance - 1 : len - 1;
} else {
// adjust current selection
pos = self.selectedIndex;
// Don't "rotate" until all items have been shown
if (distance > 0) {
if (pos === (len - 1)) {
pos = 0; // wrap
} else {
pos = Math.min(pos + distance, len - 1);
}
} else {
if (pos === 0) {
pos = (len - 1); // wrap
} else {
pos = Math.max(pos + distance, 0);
}
}
}
self._setSelectedIndex(pos);
}
// Calculate the number of items per scroll page.
function _itemsPerPage() {
var itemsPerPage = 1,
$items = self.$hintMenu.find("li"),
$view = self.$hintMenu.find("ul.dropdown-menu"),
itemHeight;
if ($items.length !== 0) {
itemHeight = $($items[0]).height();
if (itemHeight) {
// round down to integer value
itemsPerPage = Math.floor($view.height() / itemHeight);
itemsPerPage = Math.max(1, Math.min(itemsPerPage, $items.length));
}
}
return itemsPerPage;
}
// If we're no longer visible, skip handling the key and end the session.
if (!this.isOpen()) {
this.handleClose();
return false;
}
// (page) up, (page) down, enter and tab key are handled by the list
if (event.type === "keydown" && this.isHandlingKeyCode(event.keyCode)) {
keyCode = event.keyCode;
if (event.shiftKey &&
(event.keyCode === KeyEvent.DOM_VK_UP ||
event.keyCode === KeyEvent.DOM_VK_DOWN ||
event.keyCode === KeyEvent.DOM_VK_PAGE_UP ||
event.keyCode === KeyEvent.DOM_VK_PAGE_DOWN)) {
this.handleClose();
// Let the event bubble.
return false;
} else if (keyCode === KeyEvent.DOM_VK_UP) {
_rotateSelection.call(this, -1);
} else if (keyCode === KeyEvent.DOM_VK_DOWN) {
_rotateSelection.call(this, 1);
} else if (keyCode === KeyEvent.DOM_VK_PAGE_UP) {
_rotateSelection.call(this, -_itemsPerPage());
} else if (keyCode === KeyEvent.DOM_VK_PAGE_DOWN) {
_rotateSelection.call(this, _itemsPerPage());
} else if (this.selectedIndex !== -1 &&
(keyCode === KeyEvent.DOM_VK_RETURN || keyCode === KeyEvent.DOM_VK_TAB)) {
// Trigger a click handler to commmit the selected item
$(this.$hintMenu.find("li")[this.selectedIndex]).trigger("click");
} else {
// Let the event bubble.
return false;
}
event.stopImmediatePropagation();
event.preventDefault();
return true;
}
// If we didn't handle it, let other global keydown hooks handle it.
return false;
};
/**
* Is the CodeHintList open?
*
* @return {boolean}
*/
CodeHintList.prototype.isOpen = function () {
// We don't get a notification when the dropdown closes. The best
// we can do is keep an "opened" flag and check to see if we
// still have the "open" class applied.
if (this.opened && !this.$hintMenu.hasClass("open")) {
this.opened = false;
}
return this.opened;
};
/**
* Displays the hint list at the current cursor position
*
* @param {{hints: Array.<string|jQueryObject>, match: string,
* selectInitial: boolean}} hintObj
*/
CodeHintList.prototype.open = function (hintObj) {
Menus.closeAll();
this._buildListView(hintObj);
if (this.hints.length) {
// Need to add the menu to the DOM before trying to calculate its ideal location.
$("#codehint-menu-bar > ul").append(this.$hintMenu);
var hintPos = this._calcHintListLocation();
this.$hintMenu.addClass("open")
.css({"left": hintPos.left, "top": hintPos.top, "width": hintPos.width + "px"});
this.opened = true;
PopUpManager.addPopUp(this.$hintMenu, this.handleClose, true);
KeyBindingManager.addGlobalKeydownHook(this._keydownHook);
}
};
/**
* Updates the (already open) hint list window with new hints
*
* @param {{hints: Array.<string|jQueryObject>, match: string,
* selectInitial: boolean}} hintObj
*/
CodeHintList.prototype.update = function (hintObj) {
this.$hintMenu.addClass("apply-transition");
this._buildListView(hintObj);
// Update the CodeHintList location
if (this.hints.length) {
var hintPos = this._calcHintListLocation();
this.$hintMenu.css({"left": hintPos.left, "top": hintPos.top,
"width": hintPos.width + "px"});
}
};
/**
* Closes the hint list
*/
CodeHintList.prototype.close = function () {
this.$hintMenu.removeClass("open");
this.opened = false;
PopUpManager.removePopUp(this.$hintMenu);
this.$hintMenu.remove();
KeyBindingManager.removeGlobalKeydownHook(this._keydownHook);
};
/**
* Set the hint list selection callback function
*
* @param {Function} callback
*/
CodeHintList.prototype.onSelect = function (callback) {
this.handleSelect = callback;
};
/**
* Set the hint list closure callback function
*
* @param {Function} callback
*/
CodeHintList.prototype.onClose = function (callback) {
// TODO: Due to #1381, this won't get called if the user clicks out of
// the code hint menu. That's (sort of) okay right now since it doesn't
// really matter if a single old invisible code hint list is lying
// around (it will ignore keydown events, and it'll get closed the next
// time the user pops up a code hint). Once #1381 is fixed this issue
// should go away.
this.handleClose = callback;
};
// Define public API
exports.CodeHintList = CodeHintList;
});
| {
"content_hash": "9b0ebce7bb5080fb9ff679ce4c14be9b",
"timestamp": "",
"source": "github",
"line_count": 467,
"max_line_length": 98,
"avg_line_length": 33.944325481798714,
"alnum_prop": 0.5095256119101691,
"repo_name": "0bara/brackets",
"id": "eef7e6f019fc5574638177c0521ea925e9bb6f2b",
"size": "17022",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/editor/CodeHintList.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
-fx-background-image: url(../../sprites/tiles/castle-brick.png);
-fx-background-size: cover;
}
Pane {
-fx-background-image: url(../../sprites/tiles/castle-brick.png);
-fx-background-color: black;
}
Pane {
-fx-border-radius: 10 10 0 0;
-fx-background-radius: 10 10 0 0;
-fx-background-radius: 15;
}
Label{
-fx-font-family: pixeled;
-fx-font-size: 26px;
-fx-alignment: center;
-fx-text-alignment: center;
-fx-max-width: infinity;
-fx-translate-y: 12;
}
| {
"content_hash": "24e426d1500b7f6c146e32c3b653a85d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 65,
"avg_line_length": 20.166666666666668,
"alnum_prop": 0.6508264462809917,
"repo_name": "UQdeco2800/coaster",
"id": "e0fef5ac7ebd50f97fd3cfb12080a174347c78d1",
"size": "497",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "coaster/src/main/resources/screens/styles/BankStyle.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "14823"
},
{
"name": "Java",
"bytes": "1366043"
}
],
"symlink_target": ""
} |
FOUNDATION_EXPORT double BGStatePickerVersionNumber;
//! Project version string for BGStatePicker.
FOUNDATION_EXPORT const unsigned char BGStatePickerVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <BGStatePicker/PublicHeader.h>
| {
"content_hash": "e821173766ce39193aeccf57ba5ebe8c",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 138,
"avg_line_length": 38.75,
"alnum_prop": 0.8225806451612904,
"repo_name": "grimabe/BGStatePicker",
"id": "bd39270139a17c63df35b40c1d3967b18ea615d2",
"size": "531",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "BGStatePicker/BGStatePicker.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "531"
},
{
"name": "Ruby",
"bytes": "585"
},
{
"name": "Swift",
"bytes": "15429"
}
],
"symlink_target": ""
} |
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddUserProfileFieldsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('profile_fields', function (Blueprint $table) {
$table->increments('id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('profile_fields');
}
}
| {
"content_hash": "6ff4187e48cf591be80e97226caf401f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 70,
"avg_line_length": 19.3,
"alnum_prop": 0.5924006908462867,
"repo_name": "marsoltys/uservel",
"id": "88405afb783889ea3052c37e1bd470dd321347ce",
"size": "579",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "migrations/2017_10_20_094826_add_user_profile_fields_table.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "204"
},
{
"name": "HTML",
"bytes": "15897"
},
{
"name": "PHP",
"bytes": "22493"
}
],
"symlink_target": ""
} |
package org.apache.tajo.storage.thirdparty.parquet;
import static org.apache.tajo.storage.thirdparty.parquet.CodecFactory.BytesCompressor;
import static parquet.Log.INFO;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import parquet.Log;
import parquet.bytes.BytesInput;
import parquet.bytes.CapacityByteArrayOutputStream;
import parquet.column.ColumnDescriptor;
import parquet.column.Encoding;
import parquet.column.page.DictionaryPage;
import parquet.column.page.PageWriteStore;
import parquet.column.page.PageWriter;
import parquet.column.statistics.Statistics;
import parquet.column.statistics.BooleanStatistics;
import parquet.format.converter.ParquetMetadataConverter;
import parquet.io.ParquetEncodingException;
import parquet.schema.MessageType;
class ColumnChunkPageWriteStore implements PageWriteStore {
private static final Log LOG = Log.getLog(ColumnChunkPageWriteStore.class);
private static ParquetMetadataConverter parquetMetadataConverter = new ParquetMetadataConverter();
private static final class ColumnChunkPageWriter implements PageWriter {
private final ColumnDescriptor path;
private final BytesCompressor compressor;
private final CapacityByteArrayOutputStream buf;
private DictionaryPage dictionaryPage;
private long uncompressedLength;
private long compressedLength;
private long totalValueCount;
private int pageCount;
private Set<Encoding> encodings = new HashSet<Encoding>();
private Statistics totalStatistics;
private ColumnChunkPageWriter(ColumnDescriptor path, BytesCompressor compressor, int initialSize) {
this.path = path;
this.compressor = compressor;
this.buf = new CapacityByteArrayOutputStream(initialSize);
this.totalStatistics = Statistics.getStatsBasedOnType(this.path.getType());
}
@Deprecated
@Override
public void writePage(BytesInput bytes,
int valueCount,
Encoding rlEncoding,
Encoding dlEncoding,
Encoding valuesEncoding) throws IOException {
long uncompressedSize = bytes.size();
BytesInput compressedBytes = compressor.compress(bytes);
long compressedSize = compressedBytes.size();
BooleanStatistics statistics = new BooleanStatistics(); // dummy stats object
parquetMetadataConverter.writeDataPageHeader(
(int)uncompressedSize,
(int)compressedSize,
valueCount,
statistics,
rlEncoding,
dlEncoding,
valuesEncoding,
buf);
this.uncompressedLength += uncompressedSize;
this.compressedLength += compressedSize;
this.totalValueCount += valueCount;
this.pageCount += 1;
compressedBytes.writeAllTo(buf);
encodings.add(rlEncoding);
encodings.add(dlEncoding);
encodings.add(valuesEncoding);
}
@Override
public void writePage(BytesInput bytes,
int valueCount,
Statistics statistics,
Encoding rlEncoding,
Encoding dlEncoding,
Encoding valuesEncoding) throws IOException {
long uncompressedSize = bytes.size();
BytesInput compressedBytes = compressor.compress(bytes);
long compressedSize = compressedBytes.size();
parquetMetadataConverter.writeDataPageHeader(
(int)uncompressedSize,
(int)compressedSize,
valueCount,
statistics,
rlEncoding,
dlEncoding,
valuesEncoding,
buf);
this.uncompressedLength += uncompressedSize;
this.compressedLength += compressedSize;
this.totalValueCount += valueCount;
this.pageCount += 1;
this.totalStatistics.mergeStatistics(statistics);
compressedBytes.writeAllTo(buf);
encodings.add(rlEncoding);
encodings.add(dlEncoding);
encodings.add(valuesEncoding);
}
@Override
public long getMemSize() {
return buf.size();
}
public void writeToFileWriter(ParquetFileWriter writer) throws IOException {
writer.startColumn(path, totalValueCount, compressor.getCodecName());
if (dictionaryPage != null) {
writer.writeDictionaryPage(dictionaryPage);
encodings.add(dictionaryPage.getEncoding());
}
writer.writeDataPages(BytesInput.from(buf), uncompressedLength, compressedLength, totalStatistics, new ArrayList<Encoding>(encodings));
writer.endColumn();
if (INFO) {
LOG.info(
String.format(
"written %,dB for %s: %,d values, %,dB raw, %,dB comp, %d pages, encodings: %s",
buf.size(), path, totalValueCount, uncompressedLength, compressedLength, pageCount, encodings)
+ (dictionaryPage != null ? String.format(
", dic { %,d entries, %,dB raw, %,dB comp}",
dictionaryPage.getDictionarySize(), dictionaryPage.getUncompressedSize(), dictionaryPage.getDictionarySize())
: ""));
}
encodings.clear();
pageCount = 0;
}
@Override
public long allocatedSize() {
return buf.getCapacity();
}
@Override
public void writeDictionaryPage(DictionaryPage dictionaryPage) throws IOException {
if (this.dictionaryPage != null) {
throw new ParquetEncodingException("Only one dictionary page is allowed");
}
BytesInput dictionaryBytes = dictionaryPage.getBytes();
int uncompressedSize = (int)dictionaryBytes.size();
BytesInput compressedBytes = compressor.compress(dictionaryBytes);
this.dictionaryPage = new DictionaryPage(BytesInput.copy(compressedBytes), uncompressedSize, dictionaryPage.getDictionarySize(), dictionaryPage.getEncoding());
}
@Override
public String memUsageString(String prefix) {
return buf.memUsageString(prefix + " ColumnChunkPageWriter");
}
}
private final Map<ColumnDescriptor, ColumnChunkPageWriter> writers = new HashMap<ColumnDescriptor, ColumnChunkPageWriter>();
private final MessageType schema;
private final BytesCompressor compressor;
private final int initialSize;
public ColumnChunkPageWriteStore(BytesCompressor compressor, MessageType schema, int initialSize) {
this.compressor = compressor;
this.schema = schema;
this.initialSize = initialSize;
}
@Override
public PageWriter getPageWriter(ColumnDescriptor path) {
if (!writers.containsKey(path)) {
writers.put(path, new ColumnChunkPageWriter(path, compressor, initialSize));
}
return writers.get(path);
}
public void flushToFileWriter(ParquetFileWriter writer) throws IOException {
List<ColumnDescriptor> columns = schema.getColumns();
for (ColumnDescriptor columnDescriptor : columns) {
ColumnChunkPageWriter pageWriter = writers.get(columnDescriptor);
pageWriter.writeToFileWriter(writer);
}
}
} | {
"content_hash": "92cff2843e9e1307c8eaf54d93a2e6a8",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 165,
"avg_line_length": 36.45128205128205,
"alnum_prop": 0.699634214969049,
"repo_name": "yeeunshim/tajo_test",
"id": "5f89ead8f3c0e4acc653b711ed8659bfac636a8f",
"size": "7914",
"binary": false,
"copies": "1",
"ref": "refs/heads/yeeun",
"path": "tajo-storage/src/main/java/org/apache/tajo/storage/thirdparty/parquet/ColumnChunkPageWriteStore.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "40820"
},
{
"name": "CSS",
"bytes": "3794"
},
{
"name": "Java",
"bytes": "6319806"
},
{
"name": "JavaScript",
"bytes": "502571"
},
{
"name": "Python",
"bytes": "18628"
},
{
"name": "Shell",
"bytes": "64783"
},
{
"name": "XSLT",
"bytes": "1329"
}
],
"symlink_target": ""
} |
namespace QFramework.PointGame
{
public class StartGameCommand : AbstractCommand
{
protected override void OnExecute()
{
// 重置数据
var gameModel = this.GetModel<IGameModel>();
gameModel.KillCount.Value = 0;
gameModel.Score.Value = 0;
this.SendEvent<GameStartEvent>();
}
}
} | {
"content_hash": "dc20b9b5bb6c6315a3554a16289e290a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 56,
"avg_line_length": 24.5,
"alnum_prop": 0.5331632653061225,
"repo_name": "liangxiegame/QFramework",
"id": "fd6a539cf73438523c4fc83971890363d609b8e3",
"size": "402",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "QFramework.Unity2018+/Assets/QFramework/Framework/Examples/7.PointPointPoint/Scripts/Command/StartGameCommand.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "567"
},
{
"name": "C#",
"bytes": "9740113"
},
{
"name": "HLSL",
"bytes": "2843"
},
{
"name": "JavaScript",
"bytes": "3365"
},
{
"name": "Objective-C",
"bytes": "13069"
},
{
"name": "Objective-C++",
"bytes": "24246"
},
{
"name": "SCSS",
"bytes": "28496"
},
{
"name": "ShaderLab",
"bytes": "3081"
}
],
"symlink_target": ""
} |
fn main() {
let n = 1;
let a = [0, ..n]; //~ ERROR expected constant integer for repeat count but found variable
let b = [0, ..()]; //~ ERROR expected positive integer for repeat count but found ()
//~^ ERROR: expected `uint` but found `()`
let c = [0, ..true]; //~ ERROR expected positive integer for repeat count but found boolean
//~^ ERROR: expected `uint` but found `bool`
let d = [0, ..0.5]; //~ ERROR expected positive integer for repeat count but found float
//~^ ERROR: expected `uint` but found `<generic float #0>`
let e = [0, .."foo"]; //~ ERROR expected positive integer for repeat count but found string
//~^ ERROR: expected `uint` but found `&'static str`
let f = [0, ..-4];
//~^ ERROR expected positive integer for repeat count but found negative integer
}
| {
"content_hash": "20b094e327dee0a1dd3d2d51b1900bc9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 95,
"avg_line_length": 58.642857142857146,
"alnum_prop": 0.6321559074299634,
"repo_name": "pczarn/rust",
"id": "c62685d0088fe070c3ee4440339780b722973295",
"size": "1329",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "src/test/compile-fail/repeat_count.rs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "3206"
},
{
"name": "Assembly",
"bytes": "25849"
},
{
"name": "Awk",
"bytes": "159"
},
{
"name": "C",
"bytes": "684294"
},
{
"name": "C++",
"bytes": "52894"
},
{
"name": "CSS",
"bytes": "18284"
},
{
"name": "Emacs Lisp",
"bytes": "43124"
},
{
"name": "JavaScript",
"bytes": "28268"
},
{
"name": "Perl",
"bytes": "1076"
},
{
"name": "Puppet",
"bytes": "5393"
},
{
"name": "Python",
"bytes": "90614"
},
{
"name": "Rust",
"bytes": "14970417"
},
{
"name": "Shell",
"bytes": "281024"
},
{
"name": "VimL",
"bytes": "33746"
}
],
"symlink_target": ""
} |
#ifndef vaMemory_H
#define vaMemory_H
/* ------------------------------------------------------------------ */
#include "PMD_Profile.h"
#include "PostureMemory.h"
#include "PMX_Profile.h"
#include <sutQuaternion.h>
// ------------------------------------------------------------------
//mental model
using namespace MMDCppDev;
namespace VisualizationSystem {
/** --------------------------------------------------------------------
* The Axis Boundary Context.
* This struct contain the boundary information of raw PMD model and fixed PMD model
*/
struct GeometryContext {
float Center[3]; /* Center point */
float Size[3]; /* 0-Width(x), 1-Height(y), 2-Length(2)*/
float Boundary[3][2]; /* [0][0] Max X, [0][1] Min X
[1][0] Max Y, [1][1] Min Y
[2][0] Max Z, [2][1] Min Z */
float RawCenter[3]; /* Original Model information */
float RawSize[3];
float RawBoundary[3][2];
float ScaleRate;
};
/** --------------------------------------------------------------
* The deform type of vertex point.
* include 4 types : BDEF 1,
* BDEF 2,
* BDEF 4
* SDEF The deform function is under constructed.
*/
struct DeformType_BDEF1 {
int vID;
unsigned int BoneIndex;
};
struct DeformType_BDEF2 {
int vID;
unsigned int BoneIndex_1;
unsigned int BoneIndex_2;
float Weight_1;
};
struct DeformType_BDEF4 {
int vID;
unsigned int BoneIndex_1;
unsigned int BoneIndex_2;
unsigned int BoneIndex_3;
unsigned int BoneIndex_4;
float Weight_1;
float Weight_2;
float Weight_3;
float Weight_4;
};
struct DeformType_SDEF {
int vID;
unsigned int BoneIndex_1;
unsigned int BoneIndex_2;
float Weight_1;
float C[3];
float R0[3];
float R1[3];
};
/* The Vertex Unit to store vertex data, this Unit carried the index only.
* The data pointer is stored in ElementMemory.
*/
struct VertexUnitContext {
int vID; // Vertex data Index
int addID; // Additional data index
int DeformID;
unsigned char DeformType;
float EdgeScale;
};
/** The main context of vertex memory, this struct carried the vertex information of PMX/PMD files
* Include : Vertex data
* Include data
* Deform data
*/
struct VertexMemoryContext {
//--------------- Vertex Data ---------------
struct VertexUnitContext *VertexUnit;
int VertexUnitCount;
float *Vertex;
float *Normal;
float *TexCoord;
//--------------- Deform Data ---------------
int BDEF1Count;
int BDEF2Count;
int BDEF4Count;
int SDEFCount;
struct DeformType_BDEF1 *BDEF1;
struct DeformType_BDEF2 *BDEF2;
struct DeformType_BDEF4 *BDEF4;
struct DeformType_SDEF *SDEF;
};
//--------------- Index Data ---------------
struct IndexMemoryContext {
int IndexUnitCount;
int IndexUnitTypeSize; // The size of IndexUnit.
unsigned char *IndexUnit; //the type of IndexUnit could be char/short/int.
};
/** --------------------------------------------------------------------------
* The Texture Context to store texture data.
* include : Toon Texture.
* Texture (for associate material)
*/
struct TextureContext {
int Width;
int Height;
int ByteLen;
unsigned char *RGBA8888;
};
struct TextureMemoryContext {
int ToontextureCount;
struct TextureContext **ToonTextureImg ;
int TextureCount;
struct TextureContext **TextureImg ;
};
/** --------------------------------------------------------------------------
* The material Unit to store vertex data, this Unit carried the index only.
* The data pointer is stored in ElementMemory.
*/
struct MaterialUnitContext {
unsigned int JPnameKey_DKDR;
unsigned int JPnameKey_djb2;
float Diffuse_RGBA[4];
float Specular_RGBA[4];
float Ambient_RGBA[4];
float Specularity;
int SurfaceCount;
unsigned char bitFlag;
float Edge_RGBA[4];
float Edge_Scale;
int TextureIndex;
int sphereTextureIndex;
unsigned char sphereTextureBlendMode;
unsigned char ToonReference;
unsigned int ToonValue;
};
/* The main context of material memory, this struct carried the material information of PMX/PMD files
* Include : Material data
* Texture
*/
struct MaterialMemoryContext {
int MaterialUnitCount;
struct MaterialUnitContext *MaterialUnit;
};
/** --------------------------------------------------------------------------
* The Bone Unit to store vertex data,.
*/
struct IKChainUnit {
unsigned int LinkBone;
unsigned char isLimit;
float UpBound[3];
float LowerBound[3];
/* Augmented matrix/vertex is used to calculate the process matrix in CCD inverse kinematic algorithm.
* This matrix means the "local" translation/rotation in the CCD process.
*/
float cVertex[3];
float augmentedMatrix[16];
//sutQuaternionOperator Quaternion;
sutQuaternionOperator localQuaternion;
};
struct IKChainContext {
unsigned int ReachBoneID;
unsigned int TargetBoneID;
int MaxIterations;
float MaxAngle;
int IKChainCount;
struct IKChainUnit *IKChain;
};
enum BoneTypeBits {
BoneType_Linkto = 0x0001, //0x0001 : 接続先(PMD子ボーン指定)表示方法 -> 0:座標オフセットで指定 1:ボーンで指定
BoneType_isRotate = 0x0002, //0x0002 : 回転可能
BoneType_isMove = 0x0004, //0x0004 : 移動可能
BoneType_isShow = 0x0008, //0x0008 : 表示
BoneType_isAccess = 0x0010, //0x0010 : 操作可
BoneType_IK = 0x0020, //0x0020 : IK
BoneType_LocalGrant = 0x0080, //0x0080 : ローカル付与 | 付与対象 0:ユーザー変形値/IKリンク/多重付与 1:親のローカル変形量
BoneType_RotateGrant = 0x0100, //0x0100 : 回転付与
BoneType_MoveGrant = 0x0200, //0x0200 : 移動付与
BoneType_AxisFix = 0x0400, //0x0400 : 軸固定
BoneType_LocalAxis = 0x0800, //0x0800 : ローカル軸
BoneType_PhysicalDeform = 0x1000, //0x1000 : 物理後変形
BoneType_ExteranlDeform = 0x2000, //0x2000 : 外部親変形
};
struct BoneUnitContext {
int bID;
unsigned int nameKey_DKDR;
unsigned int nameKey_djb2;
float BoneVertex[3];
int bID_Parent;
int DeformableLevel;
unsigned short BoneType;
// -------------- Type data --------------
float BoneType_0x0001_BoneOffset[3];
int BoneType_0x0001_BoneIndex;
int BoneType_0x0100_BoneIndex;
float BoneType_0x0100_Percent;
float BoneType_0x0400_DirectonVertex[3];
float BoneType_0x0800_Vertex_X[3];
float BoneType_0x0800_Vertex_Z[3];
int BoneType_0x2000_Key;
};
struct BoneMemoryContext {
int NullParentID;
struct BoneUnitContext *BoneUnit;
int BoneUnitCount;
int IKChainCount;
struct IKChainContext *IKChain;
};
/* -------------------------------------------------------------- */
enum MemoryElementBits {
MemoryElement_Body = 0x01,
MemoryElement_Material = 0x02,
MemoryElement_Bone = 0x04,
MemoryElement_Face = 0x10,
MemoryElement_FULL = 0xFF
};
/* --------------------------------------------------------------------
* The Context of Visualization Memory.
* This memory is vreate from PMX or PMX context.
*/
struct vaMemoryContext {
unsigned int mID;
unsigned int MaterializeElementBitFiled; //The bit setted from MemoryElementBits.
struct GeometryContext GeometryCtx;
struct VertexMemoryContext VertexMemory;
struct IndexMemoryContext IndexMemory;
struct MaterialMemoryContext MaterialMemory;
struct TextureMemoryContext TextureMemory;
struct BoneMemoryContext BoneMemory;
};
class vaMemory {
public:
struct vaMemoryContext *create(struct PolygonModeleXtendedContext *srcPMX, unsigned int mElements);
struct vaMemoryContext *create(struct PolygonModelDataContext *srcPMD, unsigned int mElements);
void release(struct vaMemoryContext *srcVM);
private :
struct vaMemoryContext *vMemoryCtx;
/* generate data information */
int generate_VertexMemory(void *srcData, int srcMode);
int generate_VertexMemory_Soruce_PMD(struct PolygonModelDataContext *srcPMD);
int generate_VertexMemory_Soruce_PMX(struct PolygonModeleXtendedContext *srcPMX);
int generate_IndexMemory(void *srcData, int srcMode);
int generate_IndexMemory_Soruce_PMD(struct PolygonModelDataContext *srcPMD);
int generate_IndexMemory_Soruce_PMX(struct PolygonModeleXtendedContext *srcPMX);
int generate_MaterialMemory(void *srcData, int srcMode);
int generate_MaterialMemory_Soruce_PMD(struct PolygonModelDataContext *srcPMD);
int generate_MaterialMemory_Soruce_PMX(struct PolygonModeleXtendedContext *srcPMX);
int generate_TextureMemory(void *srcData, int srcMode);
int generate_TextureMemory_Soruce_PMD(struct PolygonModelDataContext *srcPMD);
int generate_TextureMemory_Soruce_PMX(struct PolygonModeleXtendedContext *srcPMX);
int generate_BoneMemory(void *srcData, int srcMode);
int generate_BoneMemory_Soruce_PMD(struct PolygonModelDataContext *srcPMD);
int generate_BoneMemory_Soruce_PMX(struct PolygonModeleXtendedContext *srcPMX);
};
}
/* ------------------------------------------------------------------ */
#endif // vaMemory_H
| {
"content_hash": "f7285d02297b0e2409ae33363656de54",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 110,
"avg_line_length": 37.41114982578397,
"alnum_prop": 0.5394430474061656,
"repo_name": "VegetableAvenger/SEngine",
"id": "09a80b4dd005b454c8898d2032791252c8163469",
"size": "10943",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libVisualizationAvatar/vaMemory.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "5669"
},
{
"name": "C++",
"bytes": "665646"
},
{
"name": "GLSL",
"bytes": "2622"
},
{
"name": "Makefile",
"bytes": "285767"
},
{
"name": "Objective-C",
"bytes": "5124"
},
{
"name": "QMake",
"bytes": "5798"
}
],
"symlink_target": ""
} |
//===--- Local.cpp - Functions that perform local SIL transformations. ----===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#include "swift/SILOptimizer/Utils/Local.h"
#include "swift/SILOptimizer/Utils/CFG.h"
#include "swift/SILOptimizer/Analysis/Analysis.h"
#include "swift/SILOptimizer/Analysis/ARCAnalysis.h"
#include "swift/SILOptimizer/Analysis/DominanceAnalysis.h"
#include "swift/AST/SubstitutionMap.h"
#include "swift/SIL/DynamicCasts.h"
#include "swift/SIL/SILArgument.h"
#include "swift/SIL/SILBuilder.h"
#include "swift/SIL/SILModule.h"
#include "swift/SIL/SILUndef.h"
#include "swift/SIL/TypeLowering.h"
#include "swift/SIL/DebugUtils.h"
#include "swift/SIL/InstructionUtils.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include <deque>
using namespace swift;
/// Creates an increment on \p Ptr before insertion point \p InsertPt that
/// creates a strong_retain if \p Ptr has reference semantics itself or a
/// retain_value if \p Ptr is a non-trivial value without reference-semantics.
SILInstruction *
swift::createIncrementBefore(SILValue Ptr, SILInstruction *InsertPt) {
// Set up the builder we use to insert at our insertion point.
SILBuilder B(InsertPt);
auto Loc = RegularLocation(SourceLoc());
// If Ptr is refcounted itself, create the strong_retain and
// return.
if (Ptr->getType().isReferenceCounted(B.getModule()))
return B.createStrongRetain(Loc, Ptr, B.getDefaultAtomicity());
// Otherwise, create the retain_value.
return B.createRetainValue(Loc, Ptr, B.getDefaultAtomicity());
}
/// Creates a decrement on \p Ptr before insertion point \p InsertPt that
/// creates a strong_release if \p Ptr has reference semantics itself or
/// a release_value if \p Ptr is a non-trivial value without reference-semantics.
SILInstruction *
swift::createDecrementBefore(SILValue Ptr, SILInstruction *InsertPt) {
// Setup the builder we will use to insert at our insertion point.
SILBuilder B(InsertPt);
auto Loc = RegularLocation(SourceLoc());
// If Ptr has reference semantics itself, create a strong_release.
if (Ptr->getType().isReferenceCounted(B.getModule()))
return B.createStrongRelease(Loc, Ptr, B.getDefaultAtomicity());
// Otherwise create a release value.
return B.createReleaseValue(Loc, Ptr, B.getDefaultAtomicity());
}
/// \brief Perform a fast local check to see if the instruction is dead.
///
/// This routine only examines the state of the instruction at hand.
bool
swift::isInstructionTriviallyDead(SILInstruction *I) {
// At Onone, consider all uses, including the debug_info.
// This way, debug_info is preserved at Onone.
if (!I->use_empty() &&
I->getModule().getOptions().Optimization <= SILOptions::SILOptMode::None)
return false;
if (!onlyHaveDebugUses(I) || isa<TermInst>(I))
return false;
if (auto *BI = dyn_cast<BuiltinInst>(I)) {
// Although the onFastPath builtin has no side-effects we don't want to
// remove it.
if (BI->getBuiltinInfo().ID == BuiltinValueKind::OnFastPath)
return false;
return !BI->mayHaveSideEffects();
}
// condfail instructions that obviously can't fail are dead.
if (auto *CFI = dyn_cast<CondFailInst>(I))
if (auto *ILI = dyn_cast<IntegerLiteralInst>(CFI->getOperand()))
if (!ILI->getValue())
return true;
// mark_uninitialized is never dead.
if (isa<MarkUninitializedInst>(I))
return false;
if (isa<MarkUninitializedBehaviorInst>(I))
return false;
if (isa<DebugValueInst>(I) || isa<DebugValueAddrInst>(I))
return false;
// These invalidate enums so "write" memory, but that is not an essential
// operation so we can remove these if they are trivially dead.
if (isa<UncheckedTakeEnumDataAddrInst>(I))
return true;
if (!I->mayHaveSideEffects())
return true;
return false;
}
/// \brief Return true if this is a release instruction and the released value
/// is a part of a guaranteed parameter.
bool swift::isIntermediateRelease(SILInstruction *I,
EpilogueARCFunctionInfo *EAFI) {
// Check whether this is a release instruction.
if (!isa<StrongReleaseInst>(I) && !isa<ReleaseValueInst>(I))
return false;
// OK. we have a release instruction.
// Check whether this is a release on part of a guaranteed function argument.
SILValue Op = stripValueProjections(I->getOperand(0));
auto *Arg = dyn_cast<SILFunctionArgument>(Op);
if (!Arg)
return false;
// This is a release on a guaranteed parameter. Its not the final release.
if (Arg->hasConvention(SILArgumentConvention::Direct_Guaranteed))
return true;
// This is a release on an owned parameter and its not the epilogue release.
// Its not the final release.
auto Rel = EAFI->computeEpilogueARCInstructions(
EpilogueARCContext::EpilogueARCKind::Release, Arg);
if (Rel.size() && !Rel.count(I))
return true;
// Failed to prove anything.
return false;
}
namespace {
using CallbackTy = std::function<void(SILInstruction *)>;
} // end anonymous namespace
void swift::
recursivelyDeleteTriviallyDeadInstructions(ArrayRef<SILInstruction *> IA,
bool Force, CallbackTy Callback) {
// Delete these instruction and others that become dead after it's deleted.
llvm::SmallPtrSet<SILInstruction *, 8> DeadInsts;
for (auto I : IA) {
// If the instruction is not dead and force is false, do nothing.
if (Force || isInstructionTriviallyDead(I))
DeadInsts.insert(I);
}
llvm::SmallPtrSet<SILInstruction *, 8> NextInsts;
while (!DeadInsts.empty()) {
for (auto I : DeadInsts) {
// Call the callback before we mutate the to be deleted instruction in any
// way.
Callback(I);
// Check if any of the operands will become dead as well.
MutableArrayRef<Operand> Ops = I->getAllOperands();
for (Operand &Op : Ops) {
SILValue OpVal = Op.get();
if (!OpVal)
continue;
// Remove the reference from the instruction being deleted to this
// operand.
Op.drop();
// If the operand is an instruction that is only used by the instruction
// being deleted, delete it.
if (SILInstruction *OpValInst = dyn_cast<SILInstruction>(OpVal))
if (!DeadInsts.count(OpValInst) &&
isInstructionTriviallyDead(OpValInst))
NextInsts.insert(OpValInst);
}
// If we have a function ref inst, we need to especially drop its function
// argument so that it gets a proper ref decrement.
auto *FRI = dyn_cast<FunctionRefInst>(I);
if (FRI && FRI->getReferencedFunction())
FRI->dropReferencedFunction();
}
for (auto I : DeadInsts) {
// This will remove this instruction and all its uses.
eraseFromParentWithDebugInsts(I);
}
NextInsts.swap(DeadInsts);
NextInsts.clear();
}
}
/// \brief If the given instruction is dead, delete it along with its dead
/// operands.
///
/// \param I The instruction to be deleted.
/// \param Force If Force is set, don't check if the top level instruction is
/// considered dead - delete it regardless.
void swift::recursivelyDeleteTriviallyDeadInstructions(SILInstruction *I,
bool Force,
CallbackTy Callback) {
ArrayRef<SILInstruction *> AI = ArrayRef<SILInstruction *>(I);
recursivelyDeleteTriviallyDeadInstructions(AI, Force, Callback);
}
void swift::eraseUsesOfInstruction(SILInstruction *Inst,
CallbackTy Callback) {
for (auto UI = Inst->use_begin(), E = Inst->use_end(); UI != E;) {
auto *User = UI->getUser();
UI++;
// If the instruction itself has any uses, recursively zap them so that
// nothing uses this instruction.
eraseUsesOfInstruction(User, Callback);
// Walk through the operand list and delete any random instructions that
// will become trivially dead when this instruction is removed.
for (auto &Op : User->getAllOperands()) {
if (auto *OpI = dyn_cast<SILInstruction>(Op.get())) {
// Don't recursively delete the pointer we're getting in.
if (OpI != Inst) {
Op.drop();
recursivelyDeleteTriviallyDeadInstructions(OpI, false, Callback);
}
}
}
Callback(User);
User->eraseFromParent();
}
}
void swift::
collectUsesOfValue(SILValue V, llvm::SmallPtrSetImpl<SILInstruction *> &Insts) {
for (auto UI = V->use_begin(), E = V->use_end(); UI != E; UI++) {
auto *User = UI->getUser();
// Instruction has been processed.
if (!Insts.insert(User).second)
continue;
// Collect the users of this instruction.
collectUsesOfValue(User, Insts);
}
}
void swift::eraseUsesOfValue(SILValue V) {
llvm::SmallPtrSet<SILInstruction *, 4> Insts;
// Collect the uses.
collectUsesOfValue(V, Insts);
// Erase the uses, we can have instructions that become dead because
// of the removal of these instructions, leave to DCE to cleanup.
// Its not safe to do recursively delete here as some of the SILInstruction
// maybe tracked by this set.
for (auto I : Insts) {
I->replaceAllUsesWithUndef();
I->eraseFromParent();
}
}
// Devirtualization of functions with covariant return types produces
// a result that is not an apply, but takes an apply as an
// argument. Attempt to dig the apply out from this result.
FullApplySite swift::findApplyFromDevirtualizedResult(SILInstruction *I) {
if (!I)
return FullApplySite();
if (auto Apply = FullApplySite::isa(I))
return Apply;
if (!I->getNumOperands())
return FullApplySite();
if (isa<UpcastInst>(I) || isa<EnumInst>(I) || isa<UncheckedRefCastInst>(I))
return findApplyFromDevirtualizedResult(
dyn_cast<SILInstruction>(I->getOperand(0)));
return FullApplySite();
}
SILValue swift::isPartialApplyOfReabstractionThunk(PartialApplyInst *PAI) {
if (PAI->getNumArguments() != 1)
return SILValue();
auto *Fun = PAI->getReferencedFunction();
if (!Fun)
return SILValue();
// Make sure we have a reabstraction thunk.
if (Fun->isThunk() != IsReabstractionThunk)
return SILValue();
// The argument should be a closure.
auto Arg = PAI->getArgument(0);
if (!Arg->getType().is<SILFunctionType>() ||
!Arg->getType().isReferenceCounted(PAI->getFunction()->getModule()))
return SILValue();
return Arg;
}
// Replace a dead apply with a new instruction that computes the same
// value, and delete the old apply.
void swift::replaceDeadApply(ApplySite Old, ValueBase *New) {
auto *OldApply = Old.getInstruction();
if (!isa<TryApplyInst>(OldApply))
OldApply->replaceAllUsesWith(New);
recursivelyDeleteTriviallyDeadInstructions(OldApply, true);
}
bool swift::hasArchetypes(SubstitutionList Subs) {
// Check whether any of the substitutions are dependent.
for (auto &sub : Subs)
if (sub.getReplacement()->hasArchetype())
return true;
return false;
}
bool swift::mayBindDynamicSelf(SILFunction *F) {
if (!F->hasSelfMetadataParam())
return false;
SILValue MDArg = F->getSelfMetadataArgument();
for (Operand *MDUse : F->getSelfMetadataArgument()->getUses()) {
SILInstruction *MDUser = MDUse->getUser();
for (Operand &TypeDepOp : MDUser->getTypeDependentOperands()) {
if (TypeDepOp.get() == MDArg)
return true;
}
}
return false;
}
/// Find a new position for an ApplyInst's FuncRef so that it dominates its
/// use. Not that FunctionRefInsts may be shared by multiple ApplyInsts.
void swift::placeFuncRef(ApplyInst *AI, DominanceInfo *DT) {
FunctionRefInst *FuncRef = cast<FunctionRefInst>(AI->getCallee());
SILBasicBlock *DomBB =
DT->findNearestCommonDominator(AI->getParent(), FuncRef->getParent());
if (DomBB == AI->getParent() && DomBB != FuncRef->getParent())
// Prefer to place the FuncRef immediately before the call. Since we're
// moving FuncRef up, this must be the only call to it in the block.
FuncRef->moveBefore(AI);
else
// Otherwise, conservatively stick it at the beginning of the block.
FuncRef->moveBefore(&*DomBB->begin());
}
/// \brief Add an argument, \p val, to the branch-edge that is pointing into
/// block \p Dest. Return a new instruction and do not erase the old
/// instruction.
TermInst *swift::addArgumentToBranch(SILValue Val, SILBasicBlock *Dest,
TermInst *Branch) {
SILBuilderWithScope Builder(Branch);
if (CondBranchInst *CBI = dyn_cast<CondBranchInst>(Branch)) {
SmallVector<SILValue, 8> TrueArgs;
SmallVector<SILValue, 8> FalseArgs;
for (auto A : CBI->getTrueArgs())
TrueArgs.push_back(A);
for (auto A : CBI->getFalseArgs())
FalseArgs.push_back(A);
if (Dest == CBI->getTrueBB()) {
TrueArgs.push_back(Val);
assert(TrueArgs.size() == Dest->getNumArguments());
} else {
FalseArgs.push_back(Val);
assert(FalseArgs.size() == Dest->getNumArguments());
}
return Builder.createCondBranch(CBI->getLoc(), CBI->getCondition(),
CBI->getTrueBB(), TrueArgs,
CBI->getFalseBB(), FalseArgs);
}
if (BranchInst *BI = dyn_cast<BranchInst>(Branch)) {
SmallVector<SILValue, 8> Args;
for (auto A : BI->getArgs())
Args.push_back(A);
Args.push_back(Val);
assert(Args.size() == Dest->getNumArguments());
return Builder.createBranch(BI->getLoc(), BI->getDestBB(), Args);
}
llvm_unreachable("unsupported terminator");
}
SILLinkage swift::getSpecializedLinkage(SILFunction *F, SILLinkage L) {
switch (L) {
case SILLinkage::Public:
case SILLinkage::PublicExternal:
case SILLinkage::Shared:
case SILLinkage::SharedExternal:
case SILLinkage::Hidden:
case SILLinkage::HiddenExternal:
// Specializations of public or hidden symbols can be shared by all TUs
// that specialize the definition.
// Treat stdlib_binary_only specially. We don't serialize the body of
// stdlib_binary_only functions so we can't mark them as Shared (making
// their visibility in the dylib hidden).
return F->hasSemanticsAttr("stdlib_binary_only") ? SILLinkage::Public
: SILLinkage::Shared;
case SILLinkage::Private:
case SILLinkage::PrivateExternal:
// Specializations of private symbols should remain so.
// TODO: maybe PrivateExternals should get SharedExternal (these are private
// functions from the stdlib which are specialized in another module).
return SILLinkage::Private;
}
llvm_unreachable("Unhandled SILLinkage in switch.");
}
/// Remove all instructions in the body of \p BB in safe manner by using
/// undef.
void swift::clearBlockBody(SILBasicBlock *BB) {
// Instructions in the dead block may be used by other dead blocks. Replace
// any uses of them with undef values.
while (!BB->empty()) {
// Grab the last instruction in the BB.
auto *Inst = &BB->back();
// Replace any still-remaining uses with undef values and erase.
Inst->replaceAllUsesWithUndef();
Inst->eraseFromParent();
}
}
// Handle the mechanical aspects of removing an unreachable block.
void swift::removeDeadBlock(SILBasicBlock *BB) {
// Clear the body of BB.
clearBlockBody(BB);
// Now that the BB is empty, eliminate it.
BB->eraseFromParent();
}
/// Cast a value into the expected, ABI compatible type if necessary.
/// This may happen e.g. when:
/// - a type of the return value is a subclass of the expected return type.
/// - actual return type and expected return type differ in optionality.
/// - both types are tuple-types and some of the elements need to be casted.
///
/// If CheckOnly flag is set, then this function only checks if the
/// required casting is possible. If it is not possible, then None
/// is returned.
///
/// If CheckOnly is not set, then a casting code is generated and the final
/// casted value is returned.
///
/// NOTE: We intentionally combine the checking of the cast's handling possibility
/// and the transformation performing the cast in the same function, to avoid
/// any divergence between the check and the implementation in the future.
///
/// NOTE: The implementation of this function is very closely related to the
/// rules checked by SILVerifier::requireABICompatibleFunctionTypes.
SILValue swift::castValueToABICompatibleType(SILBuilder *B, SILLocation Loc,
SILValue Value,
SILType SrcTy, SILType DestTy) {
// No cast is required if types are the same.
if (SrcTy == DestTy)
return Value;
assert(SrcTy.isAddress() == DestTy.isAddress() &&
"Addresses aren't compatible with values");
if (SrcTy.isAddress() && DestTy.isAddress()) {
// Cast between two addresses and that's it.
return B->createUncheckedAddrCast(Loc, Value, DestTy);
}
// If both types are classes and dest is the superclass of src,
// simply perform an upcast.
if (DestTy.isExactSuperclassOf(SrcTy)) {
return B->createUpcast(Loc, Value, DestTy);
}
if (SrcTy.isHeapObjectReferenceType() &&
DestTy.isHeapObjectReferenceType()) {
return B->createUncheckedRefCast(Loc, Value, DestTy);
}
if (auto mt1 = SrcTy.getAs<AnyMetatypeType>()) {
if (auto mt2 = DestTy.getAs<AnyMetatypeType>()) {
if (mt1->getRepresentation() == mt2->getRepresentation()) {
// If B.Type needs to be casted to A.Type and
// A is a superclass of B, then it can be done by means
// of a simple upcast.
if (mt2.getInstanceType()->isExactSuperclassOf(
mt1.getInstanceType(), nullptr)) {
return B->createUpcast(Loc, Value, DestTy);
}
// Cast between two metatypes and that's it.
return B->createUncheckedBitCast(Loc, Value, DestTy);
}
}
}
// Check if src and dest types are optional.
auto OptionalSrcTy = SrcTy.getAnyOptionalObjectType();
auto OptionalDestTy = DestTy.getAnyOptionalObjectType();
// Both types are optional.
if (OptionalDestTy && OptionalSrcTy) {
// If both wrapped types are classes and dest is the superclass of src,
// simply perform an upcast.
if (OptionalDestTy.isExactSuperclassOf(OptionalSrcTy)) {
// Insert upcast.
return B->createUpcast(Loc, Value, DestTy);
}
// Unwrap the original optional value.
auto *SomeDecl = B->getASTContext().getOptionalSomeDecl();
auto *NoneBB = B->getFunction().createBasicBlock();
auto *SomeBB = B->getFunction().createBasicBlock();
auto *CurBB = B->getInsertionPoint()->getParent();
auto *ContBB = CurBB->split(B->getInsertionPoint());
ContBB->createPHIArgument(DestTy, ValueOwnershipKind::Owned);
SmallVector<std::pair<EnumElementDecl *, SILBasicBlock *>, 1> CaseBBs;
CaseBBs.push_back(std::make_pair(SomeDecl, SomeBB));
B->setInsertionPoint(CurBB);
B->createSwitchEnum(Loc, Value, NoneBB, CaseBBs);
// Handle the Some case.
B->setInsertionPoint(SomeBB);
SILValue UnwrappedValue = B->createUncheckedEnumData(Loc, Value,
SomeDecl);
// Cast the unwrapped value.
auto CastedUnwrappedValue =
castValueToABICompatibleType(B, Loc, UnwrappedValue,
OptionalSrcTy,
OptionalDestTy);
// Wrap into optional.
auto CastedValue = B->createOptionalSome(Loc, CastedUnwrappedValue, DestTy);
B->createBranch(Loc, ContBB, {CastedValue});
// Handle the None case.
B->setInsertionPoint(NoneBB);
CastedValue = B->createOptionalNone(Loc, DestTy);
B->createBranch(Loc, ContBB, {CastedValue});
B->setInsertionPoint(ContBB->begin());
return ContBB->getArgument(0);
}
// Src is not optional, but dest is optional.
if (!OptionalSrcTy && OptionalDestTy) {
auto OptionalSrcCanTy = OptionalType::get(SrcTy.getSwiftRValueType())
->getCanonicalType();
auto LoweredOptionalSrcType = SILType::getPrimitiveObjectType(
OptionalSrcCanTy);
// Wrap the source value into an optional first.
SILValue WrappedValue = B->createOptionalSome(Loc, Value,
LoweredOptionalSrcType);
// Cast the wrapped value.
return castValueToABICompatibleType(B, Loc, WrappedValue,
WrappedValue->getType(),
DestTy);
}
// Handle tuple types.
// Extract elements, cast each of them, create a new tuple.
if (auto SrcTupleTy = SrcTy.getAs<TupleType>()) {
SmallVector<SILValue, 8> ExpectedTuple;
for (unsigned i = 0, e = SrcTupleTy->getNumElements(); i < e; i++) {
SILValue Element = B->createTupleExtract(Loc, Value, i);
// Cast the value if necessary.
Element = castValueToABICompatibleType(B, Loc, Element,
SrcTy.getTupleElementType(i),
DestTy.getTupleElementType(i));
ExpectedTuple.push_back(Element);
}
return B->createTuple(Loc, DestTy, ExpectedTuple);
}
// Function types are interchangeable if they're also ABI-compatible.
if (SrcTy.getAs<SILFunctionType>()) {
if (DestTy.getAs<SILFunctionType>()) {
// Insert convert_function.
return B->createConvertFunction(Loc, Value, DestTy);
}
}
llvm::errs() << "Source type: " << SrcTy << "\n";
llvm::errs() << "Destination type: " << DestTy << "\n";
llvm_unreachable("Unknown combination of types for casting");
}
ProjectBoxInst *swift::getOrCreateProjectBox(AllocBoxInst *ABI, unsigned Index){
SILBasicBlock::iterator Iter(ABI);
Iter++;
assert(Iter != ABI->getParent()->end() &&
"alloc_box cannot be the last instruction of a block");
SILInstruction *NextInst = &*Iter;
if (auto *PBI = dyn_cast<ProjectBoxInst>(NextInst)) {
if (PBI->getOperand() == ABI && PBI->getFieldIndex() == Index)
return PBI;
}
SILBuilder B(NextInst);
return B.createProjectBox(ABI->getLoc(), ABI, Index);
}
//===----------------------------------------------------------------------===//
// String Concatenation Optimizer
//===----------------------------------------------------------------------===//
namespace {
/// This is a helper class that performs optimization of string literals
/// concatenation.
class StringConcatenationOptimizer {
/// Apply instruction being optimized.
ApplyInst *AI;
/// Builder to be used for creation of new instructions.
SILBuilder &Builder;
/// Left string literal operand of a string concatenation.
StringLiteralInst *SLILeft = nullptr;
/// Right string literal operand of a string concatenation.
StringLiteralInst *SLIRight = nullptr;
/// Function used to construct the left string literal.
FunctionRefInst *FRILeft = nullptr;
/// Function used to construct the right string literal.
FunctionRefInst *FRIRight = nullptr;
/// Apply instructions used to construct left string literal.
ApplyInst *AILeft = nullptr;
/// Apply instructions used to construct right string literal.
ApplyInst *AIRight = nullptr;
/// String literal conversion function to be used.
FunctionRefInst *FRIConvertFromBuiltin = nullptr;
/// Result type of a function producing the concatenated string literal.
SILValue FuncResultType;
/// Internal helper methods
bool extractStringConcatOperands();
void adjustEncodings();
APInt getConcatenatedLength();
bool isAscii() const;
public:
StringConcatenationOptimizer(ApplyInst *AI, SILBuilder &Builder)
: AI(AI), Builder(Builder) {}
/// Tries to optimize a given apply instruction if it is a
/// concatenation of string literals.
///
/// Returns a new instruction if optimization was possible.
SILInstruction *optimize();
};
} // end anonymous namespace
/// Checks operands of a string concatenation operation to see if
/// optimization is applicable.
///
/// Returns false if optimization is not possible.
/// Returns true and initializes internal fields if optimization is possible.
bool StringConcatenationOptimizer::extractStringConcatOperands() {
auto *Fn = AI->getReferencedFunction();
if (!Fn)
return false;
if (AI->getNumOperands() != 3 || !Fn->hasSemanticsAttr("string.concat"))
return false;
// Left and right operands of a string concatenation operation.
AILeft = dyn_cast<ApplyInst>(AI->getOperand(1));
AIRight = dyn_cast<ApplyInst>(AI->getOperand(2));
if (!AILeft || !AIRight)
return false;
FRILeft = dyn_cast<FunctionRefInst>(AILeft->getCallee());
FRIRight = dyn_cast<FunctionRefInst>(AIRight->getCallee());
if (!FRILeft || !FRIRight)
return false;
auto *FRILeftFun = FRILeft->getReferencedFunction();
auto *FRIRightFun = FRIRight->getReferencedFunction();
if (FRILeftFun->getEffectsKind() >= EffectsKind::ReadWrite ||
FRIRightFun->getEffectsKind() >= EffectsKind::ReadWrite)
return false;
if (!FRILeftFun->hasSemanticsAttrs() || !FRIRightFun->hasSemanticsAttrs())
return false;
auto AILeftOperandsNum = AILeft->getNumOperands();
auto AIRightOperandsNum = AIRight->getNumOperands();
// makeUTF16 should have following parameters:
// (start: RawPointer, utf16CodeUnitCount: Word)
// makeUTF8 should have following parameters:
// (start: RawPointer, utf8CodeUnitCount: Word, isASCII: Int1)
if (!((FRILeftFun->hasSemanticsAttr("string.makeUTF16") &&
AILeftOperandsNum == 4) ||
(FRILeftFun->hasSemanticsAttr("string.makeUTF8") &&
AILeftOperandsNum == 5) ||
(FRIRightFun->hasSemanticsAttr("string.makeUTF16") &&
AIRightOperandsNum == 4) ||
(FRIRightFun->hasSemanticsAttr("string.makeUTF8") &&
AIRightOperandsNum == 5)))
return false;
SLILeft = dyn_cast<StringLiteralInst>(AILeft->getOperand(1));
SLIRight = dyn_cast<StringLiteralInst>(AIRight->getOperand(1));
if (!SLILeft || !SLIRight)
return false;
// Only UTF-8 and UTF-16 encoded string literals are supported by this
// optimization.
if (SLILeft->getEncoding() != StringLiteralInst::Encoding::UTF8 &&
SLILeft->getEncoding() != StringLiteralInst::Encoding::UTF16)
return false;
if (SLIRight->getEncoding() != StringLiteralInst::Encoding::UTF8 &&
SLIRight->getEncoding() != StringLiteralInst::Encoding::UTF16)
return false;
return true;
}
/// Ensures that both string literals to be concatenated use the same
/// UTF encoding. Converts UTF-8 into UTF-16 if required.
void StringConcatenationOptimizer::adjustEncodings() {
if (SLILeft->getEncoding() == SLIRight->getEncoding()) {
FRIConvertFromBuiltin = FRILeft;
if (SLILeft->getEncoding() == StringLiteralInst::Encoding::UTF8) {
FuncResultType = AILeft->getOperand(4);
} else {
FuncResultType = AILeft->getOperand(3);
}
return;
}
Builder.setCurrentDebugScope(AI->getDebugScope());
// If one of the string literals is UTF8 and another one is UTF16,
// convert the UTF8-encoded string literal into UTF16-encoding first.
if (SLILeft->getEncoding() == StringLiteralInst::Encoding::UTF8 &&
SLIRight->getEncoding() == StringLiteralInst::Encoding::UTF16) {
FuncResultType = AIRight->getOperand(3);
FRIConvertFromBuiltin = FRIRight;
// Convert UTF8 representation into UTF16.
SLILeft = Builder.createStringLiteral(AI->getLoc(), SLILeft->getValue(),
StringLiteralInst::Encoding::UTF16);
}
if (SLIRight->getEncoding() == StringLiteralInst::Encoding::UTF8 &&
SLILeft->getEncoding() == StringLiteralInst::Encoding::UTF16) {
FuncResultType = AILeft->getOperand(3);
FRIConvertFromBuiltin = FRILeft;
// Convert UTF8 representation into UTF16.
SLIRight = Builder.createStringLiteral(AI->getLoc(), SLIRight->getValue(),
StringLiteralInst::Encoding::UTF16);
}
// It should be impossible to have two operands with different
// encodings at this point.
assert(SLILeft->getEncoding() == SLIRight->getEncoding() &&
"Both operands of string concatenation should have the same encoding");
}
/// Computes the length of a concatenated string literal.
APInt StringConcatenationOptimizer::getConcatenatedLength() {
// Real length of string literals computed based on its contents.
// Length is in code units.
auto SLILenLeft = SLILeft->getCodeUnitCount();
(void) SLILenLeft;
auto SLILenRight = SLIRight->getCodeUnitCount();
(void) SLILenRight;
// Length of string literals as reported by string.make functions.
auto *LenLeft = dyn_cast<IntegerLiteralInst>(AILeft->getOperand(2));
auto *LenRight = dyn_cast<IntegerLiteralInst>(AIRight->getOperand(2));
// Real and reported length should be the same.
assert(SLILenLeft == LenLeft->getValue() &&
"Size of string literal in @_semantics(string.make) is wrong");
assert(SLILenRight == LenRight->getValue() &&
"Size of string literal in @_semantics(string.make) is wrong");
// Compute length of the concatenated literal.
return LenLeft->getValue() + LenRight->getValue();
}
/// Computes the isAscii flag of a concatenated UTF8-encoded string literal.
bool StringConcatenationOptimizer::isAscii() const{
// Add the isASCII argument in case of UTF8.
// IsASCII is true only if IsASCII of both literals is true.
auto *AsciiLeft = dyn_cast<IntegerLiteralInst>(AILeft->getOperand(3));
auto *AsciiRight = dyn_cast<IntegerLiteralInst>(AIRight->getOperand(3));
auto IsAsciiLeft = AsciiLeft->getValue() == 1;
auto IsAsciiRight = AsciiRight->getValue() == 1;
return IsAsciiLeft && IsAsciiRight;
}
SILInstruction *StringConcatenationOptimizer::optimize() {
// Bail out if string literals concatenation optimization is
// not possible.
if (!extractStringConcatOperands())
return nullptr;
// Perform string literal encodings adjustments if needed.
adjustEncodings();
// Arguments of the new StringLiteralInst to be created.
SmallVector<SILValue, 4> Arguments;
// Encoding to be used for the concatenated string literal.
auto Encoding = SLILeft->getEncoding();
// Create a concatenated string literal.
Builder.setCurrentDebugScope(AI->getDebugScope());
auto LV = SLILeft->getValue();
auto RV = SLIRight->getValue();
auto *NewSLI =
Builder.createStringLiteral(AI->getLoc(), LV + Twine(RV), Encoding);
Arguments.push_back(NewSLI);
// Length of the concatenated literal according to its encoding.
auto *Len = Builder.createIntegerLiteral(
AI->getLoc(), AILeft->getOperand(2)->getType(), getConcatenatedLength());
Arguments.push_back(Len);
// isAscii flag for UTF8-encoded string literals.
if (Encoding == StringLiteralInst::Encoding::UTF8) {
bool IsAscii = isAscii();
auto ILType = AILeft->getOperand(3)->getType();
auto *Ascii =
Builder.createIntegerLiteral(AI->getLoc(), ILType, intmax_t(IsAscii));
Arguments.push_back(Ascii);
}
// Type.
Arguments.push_back(FuncResultType);
auto FnTy = FRIConvertFromBuiltin->getType();
auto fnConv = FRIConvertFromBuiltin->getConventions();
auto STResultType = fnConv.getSILResultType();
return Builder.createApply(AI->getLoc(), FRIConvertFromBuiltin, FnTy,
STResultType, SubstitutionList(), Arguments,
false);
}
/// Top level entry point
SILInstruction *swift::tryToConcatenateStrings(ApplyInst *AI, SILBuilder &B) {
return StringConcatenationOptimizer(AI, B).optimize();
}
//===----------------------------------------------------------------------===//
// Closure Deletion
//===----------------------------------------------------------------------===//
static bool useDoesNotKeepClosureAlive(const SILInstruction *I) {
switch (I->getKind()) {
case ValueKind::StrongRetainInst:
case ValueKind::StrongReleaseInst:
case ValueKind::RetainValueInst:
case ValueKind::ReleaseValueInst:
case ValueKind::DebugValueInst:
return true;
default:
return false;
}
}
void swift::releasePartialApplyCapturedArg(SILBuilder &Builder, SILLocation Loc,
SILValue Arg, SILParameterInfo PInfo,
InstModCallbacks Callbacks) {
// If we have a non-trivial type and the argument is passed in @inout, we do
// not need to destroy it here. This is something that is implicit in the
// partial_apply design that will be revisited when partial_apply is
// redesigned.
if (PInfo.isIndirectMutating())
return;
if (isa<AllocStackInst>(Arg)) {
return;
}
// If we have a trivial type, we do not need to put in any extra releases.
if (Arg->getType().isTrivial(Builder.getModule()))
return;
// Otherwise, we need to destroy the argument.
if (Arg->getType().isObject()) {
if (Arg->getType().hasReferenceSemantics()) {
auto U = Builder.emitStrongRelease(Loc, Arg);
if (U.isNull())
return;
if (auto *SRI = U.dyn_cast<StrongRetainInst *>()) {
Callbacks.DeleteInst(SRI);
return;
}
Callbacks.CreatedNewInst(U.get<StrongReleaseInst *>());
return;
}
auto U = Builder.emitReleaseValue(Loc, Arg);
if (U.isNull())
return;
if (auto *RVI = U.dyn_cast<RetainValueInst *>()) {
Callbacks.DeleteInst(RVI);
return;
}
Callbacks.CreatedNewInst(U.get<ReleaseValueInst *>());
return;
}
SILInstruction *NewInst = Builder.emitDestroyAddrAndFold(Loc, Arg);
Callbacks.CreatedNewInst(NewInst);
}
/// For each captured argument of PAI, decrement the ref count of the captured
/// argument as appropriate at each of the post dominated release locations
/// found by Tracker.
static void releaseCapturedArgsOfDeadPartialApply(PartialApplyInst *PAI,
ReleaseTracker &Tracker,
InstModCallbacks Callbacks) {
SILBuilderWithScope Builder(PAI);
SILLocation Loc = PAI->getLoc();
CanSILFunctionType PAITy =
PAI->getCallee()->getType().getAs<SILFunctionType>();
// Emit a destroy value for each captured closure argument.
ArrayRef<SILParameterInfo> Params = PAITy->getParameters();
auto Args = PAI->getArguments();
unsigned Delta = Params.size() - Args.size();
assert(Delta <= Params.size() && "Error, more Args to partial apply than "
"params in its interface.");
for (auto *FinalRelease : Tracker.getFinalReleases()) {
Builder.setInsertionPoint(FinalRelease);
for (unsigned AI = 0, AE = Args.size(); AI != AE; ++AI) {
SILValue Arg = Args[AI];
SILParameterInfo Param = Params[AI + Delta];
releasePartialApplyCapturedArg(Builder, Loc, Arg, Param, Callbacks);
}
}
}
/// TODO: Generalize this to general objects.
bool swift::tryDeleteDeadClosure(SILInstruction *Closure,
InstModCallbacks Callbacks) {
// We currently only handle locally identified values that do not escape. We
// also assume that the partial apply does not capture any addresses.
if (!isa<PartialApplyInst>(Closure) && !isa<ThinToThickFunctionInst>(Closure))
return false;
// We only accept a user if it is an ARC object that can be removed if the
// object is dead. This should be expanded in the future. This also ensures
// that we are locally identified and non-escaping since we only allow for
// specific ARC users.
ReleaseTracker Tracker([](const SILInstruction *I) -> bool {
return useDoesNotKeepClosureAlive(I);
});
// Find the ARC Users and the final retain, release.
if (!getFinalReleasesForValue(SILValue(Closure), Tracker))
return false;
// If we have a partial_apply, release each captured argument at each one of
// the final release locations of the partial apply.
if (auto *PAI = dyn_cast<PartialApplyInst>(Closure))
releaseCapturedArgsOfDeadPartialApply(PAI, Tracker, Callbacks);
// Then delete all user instructions.
for (auto *User : Tracker.getTrackedUsers()) {
assert(!User->hasValue() && "We expect only ARC operations without "
"results. This is true b/c of "
"isARCOperationRemovableIfObjectIsDead");
Callbacks.DeleteInst(User);
}
// Finally delete the closure.
Callbacks.DeleteInst(Closure);
return true;
}
//===----------------------------------------------------------------------===//
// Value Lifetime
//===----------------------------------------------------------------------===//
void ValueLifetimeAnalysis::propagateLiveness() {
assert(LiveBlocks.empty() && "frontier computed twice");
auto DefBB = DefValue->getParentBlock();
llvm::SmallVector<SILBasicBlock *, 64> Worklist;
// Find the initial set of blocks where the value is live, because
// it is used in those blocks.
for (SILInstruction *User : UserSet) {
SILBasicBlock *UserBlock = User->getParent();
if (LiveBlocks.insert(UserBlock))
Worklist.push_back(UserBlock);
}
// Now propagate liveness backwards until we hit the block that defines the
// value.
while (!Worklist.empty()) {
auto *BB = Worklist.pop_back_val();
// Don't go beyond the definition.
if (BB == DefBB)
continue;
for (SILBasicBlock *Pred : BB->getPredecessorBlocks()) {
// If it's already in the set, then we've already queued and/or
// processed the predecessors.
if (LiveBlocks.insert(Pred))
Worklist.push_back(Pred);
}
}
}
SILInstruction *ValueLifetimeAnalysis:: findLastUserInBlock(SILBasicBlock *BB) {
// Walk backwards in BB looking for last use of the value.
for (auto II = BB->rbegin(); II != BB->rend(); ++II) {
assert(DefValue != &*II && "Found def before finding use!");
if (UserSet.count(&*II))
return &*II;
}
llvm_unreachable("Expected to find use of value in block!");
}
bool ValueLifetimeAnalysis::computeFrontier(Frontier &Fr, Mode mode) {
bool NoCriticalEdges = true;
// Exit-blocks from the lifetime region. The value is live at the end of
// a predecessor block but not in the frontier block itself.
llvm::SmallSetVector<SILBasicBlock *, 16> FrontierBlocks;
// Blocks where the value is live at the end of the block and which have
// a frontier block as successor.
llvm::SmallSetVector<SILBasicBlock *, 16> LiveOutBlocks;
/// The lifetime ends if we have a live block and a not-live successor.
for (SILBasicBlock *BB : LiveBlocks) {
bool LiveInSucc = false;
bool DeadInSucc = false;
for (const SILSuccessor &Succ : BB->getSuccessors()) {
if (LiveBlocks.count(Succ)) {
LiveInSucc = true;
} else {
DeadInSucc = true;
}
}
if (!LiveInSucc) {
// The value is not live in any of the successor blocks. This means the
// block contains a last use of the value. The next instruction after
// the last use is part of the frontier.
SILInstruction *LastUser = findLastUserInBlock(BB);
if (!isa<TermInst>(LastUser)) {
Fr.push_back(&*std::next(LastUser->getIterator()));
continue;
}
// In case the last user is a TermInst we add all successor blocks to the
// frontier (see below).
assert(DeadInSucc && "The final using TermInst must have successors");
}
if (DeadInSucc && mode != IgnoreExitEdges) {
// The value is not live in some of the successor blocks.
LiveOutBlocks.insert(BB);
for (const SILSuccessor &Succ : BB->getSuccessors()) {
if (!LiveBlocks.count(Succ)) {
// It's an "exit" edge from the lifetime region.
FrontierBlocks.insert(Succ);
}
}
}
}
// Handle "exit" edges from the lifetime region.
llvm::SmallPtrSet<SILBasicBlock *, 16> UnhandledFrontierBlocks;
for (SILBasicBlock *FrontierBB: FrontierBlocks) {
bool needSplit = false;
// If the value is live only in part of the predecessor blocks we have to
// split those predecessor edges.
for (SILBasicBlock *Pred : FrontierBB->getPredecessorBlocks()) {
if (!LiveOutBlocks.count(Pred)) {
needSplit = true;
break;
}
}
if (needSplit) {
if (mode == DontModifyCFG)
return false;
// We need to split the critical edge to create a frontier instruction.
UnhandledFrontierBlocks.insert(FrontierBB);
} else {
// The first instruction of the exit-block is part of the frontier.
Fr.push_back(&*FrontierBB->begin());
}
}
// Split critical edges from the lifetime region to not yet handled frontier
// blocks.
for (SILBasicBlock *FrontierPred : LiveOutBlocks) {
auto *T = FrontierPred->getTerminator();
// Cache the successor blocks because splitting critical edges invalidates
// the successor list iterator of T.
llvm::SmallVector<SILBasicBlock *, 4> SuccBlocks;
for (const SILSuccessor &Succ : T->getSuccessors())
SuccBlocks.push_back(Succ);
for (unsigned i = 0, e = SuccBlocks.size(); i != e; ++i) {
if (UnhandledFrontierBlocks.count(SuccBlocks[i])) {
assert(isCriticalEdge(T, i) && "actually not a critical edge?");
SILBasicBlock *NewBlock = splitEdge(T, i);
// The single terminator instruction is part of the frontier.
Fr.push_back(&*NewBlock->begin());
NoCriticalEdges = false;
}
}
}
return NoCriticalEdges;
}
bool ValueLifetimeAnalysis::isWithinLifetime(SILInstruction *Inst) {
SILBasicBlock *BB = Inst->getParent();
// Check if the value is not live anywhere in Inst's block.
if (!LiveBlocks.count(BB))
return false;
for (const SILSuccessor &Succ : BB->getSuccessors()) {
// If the value is live at the beginning of any successor block it is also
// live at the end of BB and therefore Inst is definitely in the lifetime
// region (Note that we don't check in upward direction against the value's
// definition).
if (LiveBlocks.count(Succ))
return true;
}
// The value is live in the block but not at the end of the block. Check if
// Inst is located before (or at) the last use.
for (auto II = BB->rbegin(); II != BB->rend(); ++II) {
if (UserSet.count(&*II)) {
return true;
}
if (Inst == &*II)
return false;
}
llvm_unreachable("Expected to find use of value in block!");
}
void ValueLifetimeAnalysis::dump() const {
llvm::errs() << "lifetime of def: " << *DefValue;
for (SILInstruction *Use : UserSet) {
llvm::errs() << " use: " << *Use;
}
llvm::errs() << " live blocks:";
for (SILBasicBlock *BB : LiveBlocks) {
llvm::errs() << ' ' << BB->getDebugID();
}
llvm::errs() << '\n';
}
//===----------------------------------------------------------------------===//
// Casts Optimization and Simplification
//===----------------------------------------------------------------------===//
/// Check if is a bridging cast, i.e. one of the sides is
/// a bridged type.
static bool isBridgingCast(CanType SourceType, CanType TargetType) {
// Bridging casts cannot be further simplified.
auto TargetIsBridgeable = TargetType->isBridgeableObjectType();
auto SourceIsBridgeable = SourceType->isBridgeableObjectType();
if (TargetIsBridgeable != SourceIsBridgeable)
return true;
return false;
}
/// If target is a Swift type bridging to an ObjC type,
/// return the ObjC type it bridges to.
/// If target is an ObjC type, return this type.
static Type getCastFromObjC(SILModule &M, CanType source, CanType target) {
return M.getASTContext().getBridgedToObjC(M.getSwiftModule(), target);
}
/// Create a call of _forceBridgeFromObjectiveC_bridgeable or
/// _conditionallyBridgeFromObjectiveC_bridgeable which converts an ObjC
/// instance into a corresponding Swift type, conforming to
/// _ObjectiveCBridgeable.
SILInstruction *
CastOptimizer::
optimizeBridgedObjCToSwiftCast(SILInstruction *Inst,
bool isConditional,
SILValue Src,
SILValue Dest,
CanType Source,
CanType Target,
Type BridgedSourceTy,
Type BridgedTargetTy,
SILBasicBlock *SuccessBB,
SILBasicBlock *FailureBB) {
auto &M = Inst->getModule();
auto Loc = Inst->getLoc();
// The conformance to _BridgedToObjectiveC is statically known.
// Retrieve the bridging operation to be used if a static conformance
// to _BridgedToObjectiveC can be proven.
FuncDecl *BridgeFuncDecl =
isConditional
? M.getASTContext().getConditionallyBridgeFromObjectiveCBridgeable(nullptr)
: M.getASTContext().getForceBridgeFromObjectiveCBridgeable(nullptr);
assert(BridgeFuncDecl && "_forceBridgeFromObjectiveC should exist");
SILDeclRef FuncDeclRef(BridgeFuncDecl, SILDeclRef::Kind::Func);
// Lookup a function from the stdlib.
SILFunction *BridgedFunc = M.getOrCreateFunction(
Loc, FuncDeclRef, ForDefinition_t::NotForDefinition);
if (!BridgedFunc)
return nullptr;
CanType CanBridgedTy(BridgedTargetTy);
SILType SILBridgedTy = SILType::getPrimitiveObjectType(CanBridgedTy);
SILBuilderWithScope Builder(Inst);
SILValue SrcOp;
SILInstruction *NewI = nullptr;
assert(Src->getType().isAddress() && "Source should have an address type");
assert(Dest->getType().isAddress() && "Source should have an address type");
// AnyHashable is a special case - it does not conform to NSObject -
// If AnyHashable - Bail out of the optimization
if (auto DT = Target.getNominalOrBoundGenericNominal()) {
if (DT == M.getASTContext().getAnyHashableDecl()) {
return nullptr;
}
}
// If this is a conditional cast:
// We need a new fail BB in order to add a dealloc_stack to it
SILBasicBlock *ConvFailBB = nullptr;
if (isConditional) {
auto CurrInsPoint = Builder.getInsertionPoint();
ConvFailBB = splitBasicBlockAndBranch(Builder, &(*FailureBB->begin()),
nullptr, nullptr);
Builder.setInsertionPoint(CurrInsPoint);
}
if (SILBridgedTy != Src->getType()) {
// Check if we can simplify a cast into:
// - ObjCTy to _ObjectiveCBridgeable._ObjectiveCType.
// - then convert _ObjectiveCBridgeable._ObjectiveCType to
// a Swift type using _forceBridgeFromObjectiveC.
if (!Src->getType().isLoadable(M)) {
// This code path is never reached in current test cases
// If reached, we'd have to convert from an ObjC Any* to a loadable type
// Should use check_addr / make a source we can actually load
return nullptr;
}
// Generate a load for the source argument.
auto *Load =
Builder.createLoad(Loc, Src, LoadOwnershipQualifier::Unqualified);
// Try to convert the source into the expected ObjC type first.
if (Load->getType() == SILBridgedTy) {
// If type of the source and the expected ObjC type are
// equal, there is no need to generate the conversion
// from ObjCTy to _ObjectiveCBridgeable._ObjectiveCType.
if (isConditional) {
SILBasicBlock *CastSuccessBB = Inst->getFunction()->createBasicBlock();
CastSuccessBB->createPHIArgument(SILBridgedTy,
ValueOwnershipKind::Owned);
Builder.createBranch(Loc, CastSuccessBB, SILValue(Load));
Builder.setInsertionPoint(CastSuccessBB);
SrcOp = CastSuccessBB->getArgument(0);
} else {
SrcOp = Load;
}
} else if (isConditional) {
SILBasicBlock *CastSuccessBB = Inst->getFunction()->createBasicBlock();
CastSuccessBB->createPHIArgument(SILBridgedTy, ValueOwnershipKind::Owned);
NewI = Builder.createCheckedCastBranch(Loc, false, Load, SILBridgedTy,
CastSuccessBB, ConvFailBB);
Builder.setInsertionPoint(CastSuccessBB);
SrcOp = CastSuccessBB->getArgument(0);
} else {
NewI = Builder.createUnconditionalCheckedCast(Loc, Load,
SILBridgedTy);
SrcOp = NewI;
}
} else {
SrcOp = Src;
}
// Now emit the a cast from the casted ObjC object into a target type.
// This is done by means of calling _forceBridgeFromObjectiveC or
// _conditionallyBridgeFromObjectiveC_bridgeable from the Target type.
// Lookup the required function in the Target type.
// Lookup the _ObjectiveCBridgeable protocol.
auto BridgedProto =
M.getASTContext().getProtocol(KnownProtocolKind::ObjectiveCBridgeable);
auto Conf =
*M.getSwiftModule()->lookupConformance(Target, BridgedProto, nullptr);
auto ParamTypes = BridgedFunc->getLoweredFunctionType()->getParameters();
auto *FuncRef = Builder.createFunctionRef(Loc, BridgedFunc);
auto MetaTy = MetatypeType::get(Target, MetatypeRepresentation::Thick);
auto SILMetaTy = M.Types.getTypeLowering(MetaTy).getLoweredType();
auto *MetaTyVal = Builder.createMetatype(Loc, SILMetaTy);
SmallVector<SILValue, 1> Args;
// Add substitutions
auto SubMap = SubstitutionMap::getProtocolSubstitutions(
Conf.getRequirement(), Target, Conf);
auto SILFnTy = FuncRef->getType();
SILType SubstFnTy = SILFnTy.substGenericArgs(M, SubMap);
SILFunctionConventions substConv(SubstFnTy.castTo<SILFunctionType>(), M);
SILType ResultTy = substConv.getSILResultType();
// Temporary to hold the intermediate result.
AllocStackInst *Tmp = nullptr;
CanType OptionalTy;
OptionalTypeKind OTK;
SILValue InOutOptionalParam;
if (isConditional) {
// Create a temporary
OptionalTy = OptionalType::get(Dest->getType().getSwiftRValueType())
->getImplementationType()
->getCanonicalType();
OptionalTy.getAnyOptionalObjectType(OTK);
Tmp = Builder.createAllocStack(Loc,
SILType::getPrimitiveObjectType(OptionalTy));
InOutOptionalParam = Tmp;
} else {
InOutOptionalParam = Dest;
}
(void) ParamTypes;
assert(ParamTypes[0].getConvention() == ParameterConvention::Direct_Owned &&
"Parameter should be @owned");
// Emit a retain.
Builder.createRetainValue(Loc, SrcOp, Builder.getDefaultAtomicity());
Args.push_back(InOutOptionalParam);
Args.push_back(SrcOp);
Args.push_back(MetaTyVal);
SmallVector<Substitution, 4> Subs;
Conf.getRequirement()->getGenericSignature()->getSubstitutions(SubMap, Subs);
auto *AI = Builder.createApply(Loc, FuncRef, SubstFnTy, ResultTy, Subs, Args,
false);
// If the source of a cast should be destroyed, emit a release.
if (auto *UCCAI = dyn_cast<UnconditionalCheckedCastAddrInst>(Inst)) {
assert(UCCAI->getConsumptionKind() == CastConsumptionKind::TakeAlways);
if (UCCAI->getConsumptionKind() == CastConsumptionKind::TakeAlways) {
Builder.createReleaseValue(Loc, SrcOp, Builder.getDefaultAtomicity());
}
}
if (auto *CCABI = dyn_cast<CheckedCastAddrBranchInst>(Inst)) {
if (CCABI->getConsumptionKind() == CastConsumptionKind::TakeAlways) {
Builder.createReleaseValue(Loc, SrcOp, Builder.getDefaultAtomicity());
} else if (CCABI->getConsumptionKind() ==
CastConsumptionKind::TakeOnSuccess) {
// Insert a release in the success BB.
Builder.setInsertionPoint(SuccessBB->begin());
Builder.createReleaseValue(Loc, SrcOp, Builder.getDefaultAtomicity());
}
}
// Results should be checked in case we process a conditional
// case. E.g. casts from NSArray into [SwiftType] may fail, i.e. return .None.
if (isConditional) {
// Copy the temporary into Dest.
// Load from the optional.
auto *SomeDecl = Builder.getASTContext().getOptionalSomeDecl(OTK);
SILBasicBlock *ConvSuccessBB = Inst->getFunction()->createBasicBlock();
SmallVector<std::pair<EnumElementDecl *, SILBasicBlock*>, 1> CaseBBs;
CaseBBs.push_back(std::make_pair(M.getASTContext().getOptionalNoneDecl(), FailureBB));
Builder.createSwitchEnumAddr(Loc, InOutOptionalParam, ConvSuccessBB, CaseBBs);
Builder.setInsertionPoint(FailureBB->begin());
Builder.createDeallocStack(Loc, Tmp);
Builder.setInsertionPoint(ConvSuccessBB);
auto Addr = Builder.createUncheckedTakeEnumDataAddr(Loc, InOutOptionalParam,
SomeDecl);
Builder.createCopyAddr(Loc, Addr, Dest, IsTake, IsInitialization);
Builder.createDeallocStack(Loc, Tmp);
SmallVector<SILValue, 1> SuccessBBArgs;
Builder.createBranch(Loc, SuccessBB, SuccessBBArgs);
}
EraseInstAction(Inst);
return (NewI) ? NewI : AI;
}
/// Create a call of _bridgeToObjectiveC which converts an _ObjectiveCBridgeable
/// instance into a bridged ObjC type.
SILInstruction *
CastOptimizer::
optimizeBridgedSwiftToObjCCast(SILInstruction *Inst,
CastConsumptionKind ConsumptionKind,
bool isConditional,
SILValue Src,
SILValue Dest,
CanType Source,
CanType Target,
Type BridgedSourceTy,
Type BridgedTargetTy,
SILBasicBlock *SuccessBB,
SILBasicBlock *FailureBB) {
auto &M = Inst->getModule();
auto Loc = Inst->getLoc();
bool AddressOnlyType = false;
if (!Src->getType().isLoadable(M) || !Dest->getType().isLoadable(M)) {
AddressOnlyType = true;
}
// Find the _BridgedToObjectiveC protocol.
auto BridgedProto =
M.getASTContext().getProtocol(KnownProtocolKind::ObjectiveCBridgeable);
auto Conf =
M.getSwiftModule()->lookupConformance(Source, BridgedProto, nullptr);
assert(Conf && "_ObjectiveCBridgeable conformance should exist");
(void) Conf;
// Generate code to invoke _bridgeToObjectiveC
SILBuilderWithScope Builder(Inst);
auto *NTD = Source.getNominalOrBoundGenericNominal();
assert(NTD);
SmallVector<ValueDecl *, 4> FoundMembers;
ArrayRef<ValueDecl *> Members;
Members = NTD->lookupDirect(M.getASTContext().Id_bridgeToObjectiveC);
if (Members.empty()) {
if (NTD->getDeclContext()->lookupQualified(
NTD->getDeclaredType(), M.getASTContext().Id_bridgeToObjectiveC,
NLOptions::NL_ProtocolMembers, nullptr, FoundMembers)) {
Members = FoundMembers;
// Returned members are starting with the most specialized ones.
// Thus, the first element is what we are looking for.
Members = Members.take_front(1);
}
}
// There should be exactly one implementation of _bridgeToObjectiveC.
if (Members.size() != 1)
return nullptr;
auto BridgeFuncDecl = Members.front();
auto BridgeFuncDeclRef = SILDeclRef(BridgeFuncDecl);
ModuleDecl *Mod = M.getASTContext().getLoadedModule(
M.getASTContext().Id_Foundation);
if (!Mod)
return nullptr;
SmallVector<ValueDecl *, 2> Results;
Mod->lookupMember(Results, Source.getNominalOrBoundGenericNominal(),
M.getASTContext().Id_bridgeToObjectiveC, Identifier());
ArrayRef<ValueDecl *> ResultsRef(Results);
if (ResultsRef.empty()) {
M.getSwiftModule()->lookupMember(Results, Source.getNominalOrBoundGenericNominal(),
M.getASTContext().Id_bridgeToObjectiveC, Identifier());
ResultsRef = Results;
}
if (ResultsRef.size() != 1)
return nullptr;
auto MemberDeclRef = SILDeclRef(Results.front());
auto *BridgedFunc = M.getOrCreateFunction(Loc, MemberDeclRef,
ForDefinition_t::NotForDefinition);
// Implementation of _bridgeToObjectiveC could not be found.
if (!BridgedFunc)
return nullptr;
if (Inst->getFunction()->isFragile() &&
!BridgedFunc->hasValidLinkageForFragileRef())
return nullptr;
auto ParamTypes = BridgedFunc->getLoweredFunctionType()->getParameters();
auto SILFnTy = SILType::getPrimitiveObjectType(
M.Types.getConstantFunctionType(BridgeFuncDeclRef));
// TODO: Handle return from witness function.
if (BridgedFunc->getLoweredFunctionType()
->getSingleResult()
.isFormalIndirect())
return nullptr;
// Get substitutions, if source is a bound generic type.
auto SubMap =
Source->getContextSubstitutionMap(M.getSwiftModule(),
BridgeFuncDecl->getDeclContext());
SILType SubstFnTy = SILFnTy.substGenericArgs(M, SubMap);
SILFunctionConventions substConv(SubstFnTy.castTo<SILFunctionType>(), M);
SILType ResultTy = substConv.getSILResultType();
auto FnRef = Builder.createFunctionRef(Loc, BridgedFunc);
if (Src->getType().isAddress() && !substConv.isSILIndirect(ParamTypes[0])) {
// Create load
Src = Builder.createLoad(Loc, Src, LoadOwnershipQualifier::Unqualified);
}
// Compensate different owning conventions of the replaced cast instruction
// and the inserted conversion function.
bool needRetainBeforeCall = false;
bool needReleaseAfterCall = false;
bool needReleaseInSucc = false;
switch (ParamTypes[0].getConvention()) {
case ParameterConvention::Direct_Guaranteed:
assert(!AddressOnlyType &&
"AddressOnlyType with Direct_Guaranteed is not supported");
switch (ConsumptionKind) {
case CastConsumptionKind::TakeAlways:
needReleaseAfterCall = true;
break;
case CastConsumptionKind::TakeOnSuccess:
needReleaseInSucc = true;
break;
case CastConsumptionKind::CopyOnSuccess:
// Conservatively insert a retain/release pair around the conversion
// function because the conversion function could decrement the
// (global) reference count of the source object.
//
// %src = load %global_var
// apply %conversion_func(@guaranteed %src)
//
// sil conversion_func {
// %old_value = load %global_var
// store %something_else, %global_var
// strong_release %old_value
// }
needRetainBeforeCall = true;
needReleaseAfterCall = true;
break;
}
break;
case ParameterConvention::Direct_Owned:
// The Direct_Owned case is only handled for completeness. Currently this
// cannot appear, because the _bridgeToObjectiveC protocol witness method
// always receives the this pointer (= the source) as guaranteed.
assert(!AddressOnlyType &&
"AddressOnlyType with Direct_Owned is not supported");
switch (ConsumptionKind) {
case CastConsumptionKind::TakeAlways:
break;
case CastConsumptionKind::TakeOnSuccess:
needRetainBeforeCall = true;
needReleaseInSucc = true;
break;
case CastConsumptionKind::CopyOnSuccess:
needRetainBeforeCall = true;
break;
}
break;
case ParameterConvention::Direct_Unowned:
assert(!AddressOnlyType &&
"AddressOnlyType with Direct_Unowned is not supported");
break;
case ParameterConvention::Indirect_In_Guaranteed:
// Source as-is, we don't need to copy it due to guarantee
break;
case ParameterConvention::Indirect_In: {
assert(substConv.isSILIndirect(ParamTypes[0])
&& "unsupported convention for bridging conversion");
// Need to make a copy of the source, can be changed in ObjC
auto BridgeStack = Builder.createAllocStack(Loc, Src->getType());
Src = Builder.createCopyAddr(Loc, Src, BridgeStack, IsNotTake,
IsInitialization);
break;
}
case ParameterConvention::Indirect_Inout:
case ParameterConvention::Indirect_InoutAliasable:
// TODO handle remaining indirect argument types
return nullptr;
}
if (needRetainBeforeCall)
Builder.createRetainValue(Loc, Src, Builder.getDefaultAtomicity());
SmallVector<Substitution, 4> Subs;
if (auto *Sig = Source->getAnyNominal()->getGenericSignature())
Sig->getSubstitutions(SubMap, Subs);
// Generate a code to invoke the bridging function.
auto *NewAI = Builder.createApply(Loc, FnRef, SubstFnTy, ResultTy, Subs, Src,
false);
if (needReleaseAfterCall) {
Builder.createReleaseValue(Loc, Src, Builder.getDefaultAtomicity());
} else if (needReleaseInSucc) {
SILBuilder SuccBuilder(SuccessBB->begin());
SuccBuilder.createReleaseValue(Loc, Src, SuccBuilder.getDefaultAtomicity());
}
SILInstruction *NewI = NewAI;
if (Dest) {
// If it is addr cast then store the result.
auto ConvTy = NewAI->getType();
auto DestTy = Dest->getType().getObjectType();
SILValue CastedValue;
if ((ConvTy == DestTy || DestTy.isExactSuperclassOf(ConvTy))) {
CastedValue = SILValue(
(ConvTy == DestTy) ? NewI : Builder.createUpcast(Loc, NewAI, DestTy));
} else if (ConvTy.getSwiftRValueType() ==
getNSBridgedClassOfCFClass(M.getSwiftModule(),
DestTy.getSwiftRValueType()) ||
DestTy.getSwiftRValueType() ==
getNSBridgedClassOfCFClass(M.getSwiftModule(),
ConvTy.getSwiftRValueType())) {
// Handle NS <-> CF toll-free bridging here.
CastedValue =
SILValue(Builder.createUncheckedRefCast(Loc, NewAI, DestTy));
} else {
llvm_unreachable(
"Destination should have the same type, be bridgeable CF "
"type or be a superclass "
"of the source operand");
}
NewI = Builder.createStore(Loc, CastedValue, Dest,
StoreOwnershipQualifier::Unqualified);
}
if (Dest) {
EraseInstAction(Inst);
}
return NewI;
}
/// Make use of the fact that some of these casts cannot fail.
/// For example, if the ObjC type is exactly the expected
/// _ObjectiveCType type, then it would always succeed for
/// NSString, NSNumber, etc.
/// Casts from NSArray, NSDictionary and NSSet may fail.
///
/// If ObjC class is not exactly _ObjectiveCType, then
/// its conversion to a required _ObjectiveCType may fail.
SILInstruction *
CastOptimizer::
optimizeBridgedCasts(SILInstruction *Inst,
CastConsumptionKind ConsumptionKind,
bool isConditional,
SILValue Src,
SILValue Dest,
CanType source,
CanType target,
SILBasicBlock *SuccessBB,
SILBasicBlock *FailureBB) {
auto &M = Inst->getModule();
// To apply the bridged optimizations, we should
// ensure that types are not existential,
// and that one of the types is a class and another
// one is a struct.
if (source.isAnyExistentialType() ||
target.isAnyExistentialType() ||
(source.getClassOrBoundGenericClass() &&
!target.getStructOrBoundGenericStruct()) ||
(target.getClassOrBoundGenericClass() &&
!source.getStructOrBoundGenericStruct()))
return nullptr;
// Casts involving non-bound generic types cannot be optimized.
if (source->hasArchetype() || target->hasArchetype())
return nullptr;
auto BridgedTargetTy = getCastFromObjC(M, source, target);
if (!BridgedTargetTy)
return nullptr;
auto BridgedSourceTy = getCastFromObjC(M, target, source);
if (!BridgedSourceTy)
return nullptr;
CanType CanBridgedTargetTy(BridgedTargetTy);
CanType CanBridgedSourceTy(BridgedSourceTy);
if (CanBridgedSourceTy == source && CanBridgedTargetTy == target) {
// Both source and target type are ObjC types.
return nullptr;
}
if (CanBridgedSourceTy != source && CanBridgedTargetTy != target) {
// Both source and target type are Swift types.
return nullptr;
}
if ((CanBridgedSourceTy &&
CanBridgedSourceTy->getAnyNominal() ==
M.getASTContext().getNSErrorDecl()) ||
(CanBridgedTargetTy &&
CanBridgedSourceTy->getAnyNominal() ==
M.getASTContext().getNSErrorDecl())) {
// FIXME: Can't optimize bridging with NSError.
return nullptr;
}
if (CanBridgedSourceTy || CanBridgedTargetTy) {
// Check what kind of conversion it is? ObjC->Swift or Swift-ObjC?
if (CanBridgedTargetTy != target) {
// This is an ObjC to Swift cast.
return optimizeBridgedObjCToSwiftCast(Inst, isConditional, Src, Dest, source,
target, BridgedSourceTy, BridgedTargetTy, SuccessBB, FailureBB);
} else {
// This is a Swift to ObjC cast
return optimizeBridgedSwiftToObjCCast(Inst, ConsumptionKind,
isConditional, Src, Dest, source,
target, BridgedSourceTy, BridgedTargetTy, SuccessBB, FailureBB);
}
}
llvm_unreachable("Unknown kind of bridging");
}
SILInstruction *
CastOptimizer::
simplifyCheckedCastAddrBranchInst(CheckedCastAddrBranchInst *Inst) {
if (auto *I = optimizeCheckedCastAddrBranchInst(Inst))
Inst = dyn_cast<CheckedCastAddrBranchInst>(I);
if (!Inst)
return nullptr;
auto Loc = Inst->getLoc();
auto Src = Inst->getSrc();
auto Dest = Inst->getDest();
auto SourceType = Inst->getSourceType();
auto TargetType = Inst->getTargetType();
auto *SuccessBB = Inst->getSuccessBB();
auto *FailureBB = Inst->getFailureBB();
auto &Mod = Inst->getModule();
SILBuilderWithScope Builder(Inst);
// Try to determine the outcome of the cast from a known type
// to a protocol type at compile-time.
bool isSourceTypeExact = isa<MetatypeInst>(Inst->getSrc());
// Check if we can statically predict the outcome of the cast.
auto Feasibility = classifyDynamicCast(Mod.getSwiftModule(),
SourceType,
TargetType,
isSourceTypeExact,
Mod.isWholeModule());
if (Feasibility == DynamicCastFeasibility::MaySucceed) {
return nullptr;
}
if (Feasibility == DynamicCastFeasibility::WillFail) {
if (shouldDestroyOnFailure(Inst->getConsumptionKind())) {
auto &srcTL = Builder.getModule().getTypeLowering(Src->getType());
srcTL.emitDestroyAddress(Builder, Loc, Src);
}
auto NewI = Builder.createBranch(Loc, FailureBB);
EraseInstAction(Inst);
WillFailAction();
return NewI;
}
// Cast will succeed
// Replace by unconditional_addr_cast, followed by a branch.
// The unconditional_addr_cast can be skipped, if the result of a cast
// is not used afterwards.
bool ResultNotUsed = isa<AllocStackInst>(Dest);
for (auto Use : Dest->getUses()) {
auto *User = Use->getUser();
if (isa<DeallocStackInst>(User) || User == Inst)
continue;
ResultNotUsed = false;
break;
}
auto *BB = Inst->getParent();
if (!ResultNotUsed) {
SILInstruction *BridgedI = nullptr;
// To apply the bridged optimizations, we should
// ensure that types are not existential,
// and that not both types are classes.
BridgedI = optimizeBridgedCasts(Inst, Inst->getConsumptionKind(),
true, Src, Dest, SourceType,
TargetType, SuccessBB, FailureBB);
if (!BridgedI) {
// Since it is an addr cast, only address types are handled here.
if (!Src->getType().isAddress() || !Dest->getType().isAddress()) {
return nullptr;
} else if (!emitSuccessfulIndirectUnconditionalCast(
Builder, Mod.getSwiftModule(), Loc,
Inst->getConsumptionKind(), Src, SourceType, Dest,
TargetType, Inst)) {
// No optimization was possible.
return nullptr;
}
EraseInstAction(Inst);
}
SILInstruction *NewI = &BB->back();
if (!isa<TermInst>(NewI)) {
Builder.setInsertionPoint(BB);
NewI = Builder.createBranch(Loc, SuccessBB);
}
WillSucceedAction();
return NewI;
} else {
// Result is not used.
EraseInstAction(Inst);
Builder.setInsertionPoint(BB);
auto *NewI = Builder.createBranch(Loc, SuccessBB);
WillSucceedAction();
return NewI;
}
}
SILInstruction *
CastOptimizer::simplifyCheckedCastBranchInst(CheckedCastBranchInst *Inst) {
if (Inst->isExact()) {
auto *ARI = dyn_cast<AllocRefInst>(stripUpCasts(Inst->getOperand()));
if (!ARI)
return nullptr;
// We know the dynamic type of the operand.
SILBuilderWithScope Builder(Inst);
auto Loc = Inst->getLoc();
auto *SuccessBB = Inst->getSuccessBB();
auto *FailureBB = Inst->getFailureBB();
if (ARI->getType() == Inst->getCastType()) {
// This exact cast will succeed.
SmallVector<SILValue, 1> Args;
Args.push_back(ARI);
auto *NewI = Builder.createBranch(Loc, SuccessBB, Args);
EraseInstAction(Inst);
WillSucceedAction();
return NewI;
}
// This exact cast will fail.
auto *NewI = Builder.createBranch(Loc, FailureBB);
EraseInstAction(Inst);
WillFailAction();
return NewI;
}
if (auto *I = optimizeCheckedCastBranchInst(Inst))
Inst = dyn_cast<CheckedCastBranchInst>(I);
if (!Inst)
return nullptr;
auto LoweredTargetType = Inst->getCastType();
auto SourceType = Inst->getSourceType();
auto TargetType = Inst->getTargetType();
auto Loc = Inst->getLoc();
auto *SuccessBB = Inst->getSuccessBB();
auto *FailureBB = Inst->getFailureBB();
auto Op = Inst->getOperand();
auto &Mod = Inst->getModule();
bool isSourceTypeExact = isa<MetatypeInst>(Op);
// Check if we can statically predict the outcome of the cast.
auto Feasibility = classifyDynamicCast(Mod.getSwiftModule(),
SourceType,
TargetType,
isSourceTypeExact);
if (Feasibility == DynamicCastFeasibility::MaySucceed) {
return nullptr;
}
SILBuilderWithScope Builder(Inst);
if (Feasibility == DynamicCastFeasibility::WillFail) {
auto *NewI = Builder.createBranch(Loc, FailureBB);
EraseInstAction(Inst);
WillFailAction();
return NewI;
}
// Casting will succeed.
// Replace by unconditional_cast, followed by a branch.
// The unconditional_cast can be skipped, if the result of a cast
// is not used afterwards.
bool ResultNotUsed = SuccessBB->getArgument(0)->use_empty();
SILValue CastedValue;
if (Op->getType() != LoweredTargetType) {
if (!ResultNotUsed) {
auto Src = Inst->getOperand();
auto Dest = SILValue();
// To apply the bridged casts optimizations.
auto BridgedI = optimizeBridgedCasts(Inst,
CastConsumptionKind::CopyOnSuccess, false, Src, Dest, SourceType,
TargetType, nullptr, nullptr);
if (BridgedI) {
CastedValue = BridgedI;
} else {
if (!canUseScalarCheckedCastInstructions(Mod, SourceType, TargetType))
return nullptr;
CastedValue = emitSuccessfulScalarUnconditionalCast(
Builder, Mod.getSwiftModule(), Loc, Op, LoweredTargetType,
SourceType, TargetType, Inst);
}
if (!CastedValue)
CastedValue =
Builder.createUnconditionalCheckedCast(Loc, Op, LoweredTargetType);
} else {
CastedValue = SILUndef::get(LoweredTargetType, Mod);
}
} else {
// No need to cast.
CastedValue = Op;
}
auto *NewI = Builder.createBranch(Loc, SuccessBB, CastedValue);
EraseInstAction(Inst);
WillSucceedAction();
return NewI;
}
SILInstruction *CastOptimizer::simplifyCheckedCastValueBranchInst(
CheckedCastValueBranchInst *Inst) {
if (auto *I = optimizeCheckedCastValueBranchInst(Inst))
Inst = dyn_cast<CheckedCastValueBranchInst>(I);
if (!Inst)
return nullptr;
auto LoweredTargetType = Inst->getCastType();
auto SourceType = Inst->getSourceType();
auto TargetType = Inst->getTargetType();
auto Loc = Inst->getLoc();
auto *SuccessBB = Inst->getSuccessBB();
auto *FailureBB = Inst->getFailureBB();
auto Op = Inst->getOperand();
auto &Mod = Inst->getModule();
bool isSourceTypeExact = isa<MetatypeInst>(Op);
// Check if we can statically predict the outcome of the cast.
auto Feasibility = classifyDynamicCast(Mod.getSwiftModule(), SourceType,
TargetType, isSourceTypeExact);
if (Feasibility == DynamicCastFeasibility::MaySucceed) {
return nullptr;
}
SILBuilderWithScope Builder(Inst);
if (Feasibility == DynamicCastFeasibility::WillFail) {
auto *NewI = Builder.createBranch(Loc, FailureBB);
EraseInstAction(Inst);
WillFailAction();
return NewI;
}
// Casting will succeed.
// Replace by unconditional_cast, followed by a branch.
// The unconditional_cast can be skipped, if the result of a cast
// is not used afterwards.
bool ResultNotUsed = SuccessBB->getArgument(0)->use_empty();
SILValue CastedValue;
if (Op->getType() != LoweredTargetType) {
if (!ResultNotUsed) {
auto Src = Inst->getOperand();
auto Dest = SILValue();
// To apply the bridged casts optimizations.
auto BridgedI = optimizeBridgedCasts(
Inst, CastConsumptionKind::CopyOnSuccess, false, Src, Dest,
SourceType, TargetType, nullptr, nullptr);
if (BridgedI) {
CastedValue = BridgedI;
} else {
if (!canUseScalarCheckedCastInstructions(Mod, SourceType, TargetType))
return nullptr;
CastedValue = emitSuccessfulScalarUnconditionalCast(
Builder, Mod.getSwiftModule(), Loc, Op, LoweredTargetType,
SourceType, TargetType, Inst);
}
if (!CastedValue)
CastedValue = Builder.createUnconditionalCheckedCastValue(
Loc, CastConsumptionKind::TakeAlways, Op, LoweredTargetType);
} else {
CastedValue = SILUndef::get(LoweredTargetType, Mod);
}
} else {
// No need to cast.
CastedValue = Op;
}
auto *NewI = Builder.createBranch(Loc, SuccessBB, CastedValue);
EraseInstAction(Inst);
WillSucceedAction();
return NewI;
}
SILInstruction *CastOptimizer::optimizeCheckedCastAddrBranchInst(
CheckedCastAddrBranchInst *Inst) {
auto Loc = Inst->getLoc();
auto Src = Inst->getSrc();
auto Dest = Inst->getDest();
auto *SuccessBB = Inst->getSuccessBB();
auto *FailureBB = Inst->getFailureBB();
// If there is an unbound generic type involved in the cast, bail.
if (Src->getType().hasArchetype() || Dest->getType().hasArchetype())
return nullptr;
// %1 = metatype $A.Type
// [%2 = init_existential_metatype %1 ...]
// %3 = alloc_stack
// store %1 to %3 or store %2 to %3
// checked_cast_addr_br %3 to ...
// ->
// %1 = metatype $A.Type
// %c = checked_cast_br %1 to ...
// store %c to %3 (if successful)
if (auto *ASI = dyn_cast<AllocStackInst>(Src)) {
// Check if the value of this alloc_stack is set only once by a store
// instruction, used only by CCABI and then deallocated.
bool isLegal = true;
StoreInst *Store = nullptr;
for (auto Use : ASI->getUses()) {
auto *User = Use->getUser();
if (isa<DeallocStackInst>(User) || User == Inst)
continue;
if (auto *SI = dyn_cast<StoreInst>(User)) {
if (!Store) {
Store = SI;
continue;
}
}
isLegal = false;
break;
}
if (isLegal && Store) {
// Check what was the value stored in the allocated stack slot.
auto Src = Store->getSrc();
MetatypeInst *MI = nullptr;
if (auto *IEMI = dyn_cast<InitExistentialMetatypeInst>(Src)) {
MI = dyn_cast<MetatypeInst>(IEMI->getOperand());
}
if (!MI)
MI = dyn_cast<MetatypeInst>(Src);
if (MI) {
if (SuccessBB->getSinglePredecessorBlock() &&
canUseScalarCheckedCastInstructions(
Inst->getModule(), MI->getType().getSwiftRValueType(),
Inst->getTargetType())) {
SILBuilderWithScope B(Inst);
auto NewI = B.createCheckedCastBranch(
Loc, false /*isExact*/, MI,
Dest->getType().getObjectType(), SuccessBB, FailureBB);
SuccessBB->createPHIArgument(Dest->getType().getObjectType(),
ValueOwnershipKind::Owned);
B.setInsertionPoint(SuccessBB->begin());
// Store the result
B.createStore(Loc, SuccessBB->getArgument(0), Dest,
StoreOwnershipQualifier::Unqualified);
EraseInstAction(Inst);
return NewI;
}
}
}
}
return nullptr;
}
SILInstruction *CastOptimizer::optimizeCheckedCastValueBranchInst(
CheckedCastValueBranchInst *Inst) {
// TODO
return nullptr;
}
SILInstruction *
CastOptimizer::optimizeCheckedCastBranchInst(CheckedCastBranchInst *Inst) {
if (Inst->isExact())
return nullptr;
auto LoweredTargetType = Inst->getCastType();
auto Loc = Inst->getLoc();
auto *SuccessBB = Inst->getSuccessBB();
auto *FailureBB = Inst->getFailureBB();
auto Op = Inst->getOperand();
// Try to simplify checked_cond_br instructions using existential
// metatypes by propagating a concrete type whenever it can be
// determined statically.
// %0 = metatype $A.Type
// %1 = init_existential_metatype ..., %0: $A
// checked_cond_br %1, ....
// ->
// %1 = metatype $A.Type
// checked_cond_br %1, ....
if (auto *IEMI = dyn_cast<InitExistentialMetatypeInst>(Op)) {
if (auto *MI = dyn_cast<MetatypeInst>(IEMI->getOperand())) {
SILBuilderWithScope B(Inst);
auto *NewI = B.createCheckedCastBranch(Loc, /* isExact */ false, MI,
LoweredTargetType,
SuccessBB,
FailureBB);
EraseInstAction(Inst);
return NewI;
}
}
if (auto *EMI = dyn_cast<ExistentialMetatypeInst>(Op)) {
// Operand of the existential_metatype instruction.
auto Op = EMI->getOperand();
auto EmiTy = EMI->getType();
// %0 = alloc_stack ..
// %1 = init_existential_addr %0: $A
// %2 = existential_metatype %0, ...
// checked_cond_br %2, ....
// ->
// %1 = metatype $A.Type
// checked_cond_br %1, ....
if (auto *ASI = dyn_cast<AllocStackInst>(Op)) {
// Should be in the same BB.
if (ASI->getParent() != EMI->getParent())
return nullptr;
// Check if this alloc_stack is only initialized once by means of
// single init_existential_addr.
bool isLegal = true;
// init_existential instruction used to initialize this alloc_stack.
InitExistentialAddrInst *FoundIEI = nullptr;
for (auto Use: getNonDebugUses(ASI)) {
auto *User = Use->getUser();
if (isa<ExistentialMetatypeInst>(User) ||
isa<DestroyAddrInst>(User) ||
isa<DeallocStackInst>(User))
continue;
if (auto *IEI = dyn_cast<InitExistentialAddrInst>(User)) {
if (!FoundIEI) {
FoundIEI = IEI;
continue;
}
}
isLegal = false;
break;
}
if (isLegal && FoundIEI) {
// Should be in the same BB.
if (FoundIEI->getParent() != EMI->getParent())
return nullptr;
// Get the type used to initialize the existential.
auto LoweredConcreteTy = FoundIEI->getLoweredConcreteType();
if (LoweredConcreteTy.isAnyExistentialType())
return nullptr;
// Get the metatype of this type.
auto EMT = EmiTy.castTo<AnyMetatypeType>();
auto *MetaTy = MetatypeType::get(LoweredConcreteTy.getSwiftRValueType(),
EMT->getRepresentation());
auto CanMetaTy = CanMetatypeType::CanTypeWrapper(MetaTy);
auto SILMetaTy = SILType::getPrimitiveObjectType(CanMetaTy);
SILBuilderWithScope B(Inst);
auto *MI = B.createMetatype(FoundIEI->getLoc(), SILMetaTy);
auto *NewI = B.createCheckedCastBranch(Loc, /* isExact */ false, MI,
LoweredTargetType,
SuccessBB,
FailureBB);
EraseInstAction(Inst);
return NewI;
}
}
// %0 = alloc_ref $A
// %1 = init_existential_ref %0: $A, $...
// %2 = existential_metatype ..., %1 : ...
// checked_cond_br %2, ....
// ->
// %1 = metatype $A.Type
// checked_cond_br %1, ....
if (auto *FoundIERI = dyn_cast<InitExistentialRefInst>(Op)) {
auto *ASRI = dyn_cast<AllocRefInst>(FoundIERI->getOperand());
if (!ASRI)
return nullptr;
// Should be in the same BB.
if (ASRI->getParent() != EMI->getParent())
return nullptr;
// Check if this alloc_stack is only initialized once by means of
// a single init_existential_ref.
bool isLegal = true;
for (auto Use: getNonDebugUses(ASRI)) {
auto *User = Use->getUser();
if (isa<ExistentialMetatypeInst>(User) || isa<StrongReleaseInst>(User))
continue;
if (auto *IERI = dyn_cast<InitExistentialRefInst>(User)) {
if (IERI == FoundIERI) {
continue;
}
}
isLegal = false;
break;
}
if (isLegal && FoundIERI) {
// Should be in the same BB.
if (FoundIERI->getParent() != EMI->getParent())
return nullptr;
// Get the type used to initialize the existential.
auto ConcreteTy = FoundIERI->getFormalConcreteType();
if (ConcreteTy.isAnyExistentialType())
return nullptr;
// Get the SIL metatype of this type.
auto EMT = EMI->getType().castTo<AnyMetatypeType>();
auto *MetaTy = MetatypeType::get(ConcreteTy, EMT->getRepresentation());
auto CanMetaTy = CanMetatypeType::CanTypeWrapper(MetaTy);
auto SILMetaTy = SILType::getPrimitiveObjectType(CanMetaTy);
SILBuilderWithScope B(Inst);
auto *MI = B.createMetatype(FoundIERI->getLoc(), SILMetaTy);
auto *NewI = B.createCheckedCastBranch(Loc, /* isExact */ false, MI,
LoweredTargetType,
SuccessBB,
FailureBB);
EraseInstAction(Inst);
return NewI;
}
}
}
return nullptr;
}
ValueBase *
CastOptimizer::
optimizeUnconditionalCheckedCastInst(UnconditionalCheckedCastInst *Inst) {
auto LoweredSourceType = Inst->getOperand()->getType();
auto LoweredTargetType = Inst->getType();
auto Loc = Inst->getLoc();
auto Op = Inst->getOperand();
auto &Mod = Inst->getModule();
bool isSourceTypeExact = isa<MetatypeInst>(Op);
// Check if we can statically predict the outcome of the cast.
auto Feasibility = classifyDynamicCast(Mod.getSwiftModule(),
Inst->getSourceType(),
Inst->getTargetType(),
isSourceTypeExact);
if (Feasibility == DynamicCastFeasibility::MaySucceed) {
return nullptr;
}
if (Feasibility == DynamicCastFeasibility::WillFail) {
// Remove the cast and insert a trap, followed by an
// unreachable instruction.
SILBuilderWithScope Builder(Inst);
auto *Trap = Builder.createBuiltinTrap(Loc);
Inst->replaceAllUsesWithUndef();
EraseInstAction(Inst);
Builder.setInsertionPoint(std::next(SILBasicBlock::iterator(Trap)));
auto *UnreachableInst =
Builder.createUnreachable(ArtificialUnreachableLocation());
// Delete everything after the unreachable except for dealloc_stack which we
// move before the trap.
deleteInstructionsAfterUnreachable(UnreachableInst, Trap);
WillFailAction();
return Trap;
}
if (Feasibility == DynamicCastFeasibility::WillSucceed) {
if (Inst->use_empty()) {
EraseInstAction(Inst);
WillSucceedAction();
return nullptr;
}
SILBuilderWithScope Builder(Inst);
// Try to apply the bridged casts optimizations
auto SourceType = LoweredSourceType.getSwiftRValueType();
auto TargetType = LoweredTargetType.getSwiftRValueType();
auto Src = Inst->getOperand();
auto NewI = optimizeBridgedCasts(Inst, CastConsumptionKind::CopyOnSuccess,
false, Src, SILValue(), SourceType,
TargetType, nullptr, nullptr);
if (NewI) {
ReplaceInstUsesAction(Inst, NewI);
EraseInstAction(Inst);
WillSucceedAction();
return NewI;
}
if (isBridgingCast(SourceType, TargetType))
return nullptr;
auto Result = emitSuccessfulScalarUnconditionalCast(Builder,
Mod.getSwiftModule(), Loc, Op,
LoweredTargetType,
LoweredSourceType.getSwiftRValueType(),
LoweredTargetType.getSwiftRValueType(),
Inst);
if (!Result) {
// No optimization was possible.
return nullptr;
}
ReplaceInstUsesAction(Inst, Result);
EraseInstAction(Inst);
WillSucceedAction();
return Result;
}
return nullptr;
}
/// Deletes all instructions after \p UnreachableInst except dealloc_stack
/// instructions are moved before \p TrapInst.
void CastOptimizer::deleteInstructionsAfterUnreachable(
SILInstruction *UnreachableInst, SILInstruction *TrapInst) {
auto UnreachableInstIt =
std::next(SILBasicBlock::iterator(UnreachableInst));
auto *Block = TrapInst->getParent();
while (UnreachableInstIt != Block->end()) {
SILInstruction *CurInst = &*UnreachableInstIt;
++UnreachableInstIt;
if (auto *DeallocStack = dyn_cast<DeallocStackInst>(CurInst))
if (!isa<SILUndef>(DeallocStack->getOperand())) {
DeallocStack->moveBefore(TrapInst);
continue;
}
CurInst->replaceAllUsesWithUndef();
EraseInstAction(CurInst);
}
}
SILInstruction *
CastOptimizer::
optimizeUnconditionalCheckedCastAddrInst(UnconditionalCheckedCastAddrInst *Inst) {
auto Loc = Inst->getLoc();
auto Src = Inst->getSrc();
auto Dest = Inst->getDest();
auto SourceType = Inst->getSourceType();
auto TargetType = Inst->getTargetType();
auto &Mod = Inst->getModule();
bool isSourceTypeExact = isa<MetatypeInst>(Src);
// Check if we can statically predict the outcome of the cast.
auto Feasibility = classifyDynamicCast(Mod.getSwiftModule(), SourceType,
TargetType, isSourceTypeExact);
if (Feasibility == DynamicCastFeasibility::MaySucceed) {
// Forced bridged casts can be still simplified here.
// If they fail, they fail inside the conversion function.
if (!isBridgingCast(SourceType, TargetType))
return nullptr;
}
if (Feasibility == DynamicCastFeasibility::WillFail) {
// Remove the cast and insert a trap, followed by an
// unreachable instruction.
SILBuilderWithScope Builder(Inst);
// mem2reg's invariants get unhappy if we don't try to
// initialize a loadable result.
auto DestType = Dest->getType();
auto &resultTL = Mod.Types.getTypeLowering(DestType);
if (!resultTL.isAddressOnly()) {
auto undef = SILValue(SILUndef::get(DestType.getObjectType(),
Builder.getModule()));
Builder.createStore(Loc, undef, Dest,
StoreOwnershipQualifier::Unqualified);
}
auto *TrapI = Builder.createBuiltinTrap(Loc);
Inst->replaceAllUsesWithUndef();
EraseInstAction(Inst);
Builder.setInsertionPoint(std::next(SILBasicBlock::iterator(TrapI)));
auto *UnreachableInst =
Builder.createUnreachable(ArtificialUnreachableLocation());
// Delete everything after the unreachable except for dealloc_stack which we
// move before the trap.
deleteInstructionsAfterUnreachable(UnreachableInst, TrapI);
WillFailAction();
}
if (Feasibility == DynamicCastFeasibility::WillSucceed ||
Feasibility == DynamicCastFeasibility::MaySucceed) {
bool ResultNotUsed = isa<AllocStackInst>(Dest);
DestroyAddrInst *DestroyDestInst = nullptr;
for (auto Use : Dest->getUses()) {
auto *User = Use->getUser();
if (isa<DeallocStackInst>(User) || User == Inst)
continue;
if (isa<DestroyAddrInst>(User) && !DestroyDestInst) {
DestroyDestInst = cast<DestroyAddrInst>(User);
continue;
}
ResultNotUsed = false;
break;
}
if (ResultNotUsed) {
switch (Inst->getConsumptionKind()) {
case CastConsumptionKind::TakeAlways:
case CastConsumptionKind::TakeOnSuccess: {
SILBuilder B(Inst);
B.createDestroyAddr(Inst->getLoc(), Inst->getSrc());
break;
}
case CastConsumptionKind::CopyOnSuccess:
break;
}
if (DestroyDestInst)
EraseInstAction(DestroyDestInst);
EraseInstAction(Inst);
WillSucceedAction();
return nullptr;
}
// Try to apply the bridged casts optimizations
auto NewI = optimizeBridgedCasts(Inst, Inst->getConsumptionKind(),
false, Src, Dest, SourceType,
TargetType, nullptr, nullptr);
if (NewI) {
WillSucceedAction();
return nullptr;
}
if (isBridgingCast(SourceType, TargetType))
return nullptr;
SILBuilderWithScope Builder(Inst);
if (!emitSuccessfulIndirectUnconditionalCast(Builder, Mod.getSwiftModule(),
Loc, Inst->getConsumptionKind(),
Src, SourceType,
Dest, TargetType, Inst)) {
// No optimization was possible.
return nullptr;
}
Inst->replaceAllUsesWithUndef();
EraseInstAction(Inst);
WillSucceedAction();
}
return nullptr;
}
bool swift::simplifyUsers(SILInstruction *I) {
bool Changed = false;
for (auto UI = I->use_begin(), UE = I->use_end(); UI != UE; ) {
SILInstruction *User = UI->getUser();
++UI;
if (!User->hasValue())
continue;
SILValue S = simplifyInstruction(User);
if (!S)
continue;
User->replaceAllUsesWith(S);
User->eraseFromParent();
Changed = true;
}
return Changed;
}
/// Some support functions for the global-opt and let-properties-opts
/// Check if a given type is a simple type, i.e. a builtin
/// integer or floating point type or a struct/tuple whose members
/// are of simple types.
/// TODO: Cache the "simple" flag for types to avoid repeating checks.
bool swift::isSimpleType(SILType SILTy, SILModule& Module) {
// Classes can never be initialized statically at compile-time.
if (SILTy.getClassOrBoundGenericClass()) {
return false;
}
if (!SILTy.isTrivial(Module))
return false;
return true;
}
/// Check if the value of V is computed by means of a simple initialization.
/// Store the actual SILValue into Val and the reversed list of instructions
/// initializing it in Insns.
/// The check is performed by recursively walking the computation of the
/// SIL value being analyzed.
/// TODO: Move into utils.
bool
swift::analyzeStaticInitializer(SILValue V,
SmallVectorImpl<SILInstruction *> &Insns) {
auto I = dyn_cast<SILInstruction>(V);
if (!I)
return false;
while (true) {
if (!isa<AllocGlobalInst>(I))
Insns.push_back(I);
if (auto *SI = dyn_cast<StructInst>(I)) {
// If it is not a struct which is a simple type, bail.
if (!isSimpleType(SI->getType(), I->getModule()))
return false;
for (auto &Op: SI->getAllOperands()) {
// If one of the struct instruction operands is not
// a simple initializer, bail.
if (!analyzeStaticInitializer(Op.get(), Insns))
return false;
}
return true;
} if (auto *TI = dyn_cast<TupleInst>(I)) {
// If it is not a tuple which is a simple type, bail.
if (!isSimpleType(TI->getType(), I->getModule()))
return false;
for (auto &Op: TI->getAllOperands()) {
// If one of the struct instruction operands is not
// a simple initializer, bail.
if (!analyzeStaticInitializer(Op.get(), Insns))
return false;
}
return true;
} else {
if (auto *bi = dyn_cast<BuiltinInst>(I)) {
switch (bi->getBuiltinInfo().ID) {
case BuiltinValueKind::FPTrunc:
if (auto *LI = dyn_cast<LiteralInst>(bi->getArguments()[0])) {
I = LI;
continue;
}
break;
default:
return false;
}
}
if (I->getKind() == ValueKind::IntegerLiteralInst
|| I->getKind() == ValueKind::FloatLiteralInst
|| I->getKind() == ValueKind::StringLiteralInst)
return true;
return false;
}
}
return false;
}
/// Replace load sequence which may contain
/// a chain of struct_element_addr followed by a load.
/// The sequence is traversed inside out, i.e.
/// starting with the innermost struct_element_addr
/// Move into utils.
void swift::replaceLoadSequence(SILInstruction *I,
SILInstruction *Value,
SILBuilder &B) {
if (auto *LI = dyn_cast<LoadInst>(I)) {
LI->replaceAllUsesWith(Value);
return;
}
// It is a series of struct_element_addr followed by load.
if (auto *SEAI = dyn_cast<StructElementAddrInst>(I)) {
auto *SEI = B.createStructExtract(SEAI->getLoc(), Value, SEAI->getField());
for (auto SEAIUse : SEAI->getUses()) {
replaceLoadSequence(SEAIUse->getUser(), SEI, B);
}
return;
}
if (auto *TEAI = dyn_cast<TupleElementAddrInst>(I)) {
auto *TEI = B.createTupleExtract(TEAI->getLoc(), Value, TEAI->getFieldNo());
for (auto TEAIUse : TEAI->getUses()) {
replaceLoadSequence(TEAIUse->getUser(), TEI, B);
}
return;
}
llvm_unreachable("Unknown instruction sequence for reading from a global");
}
/// Are the callees that could be called through Decl statically
/// knowable based on the Decl and the compilation mode?
bool swift::calleesAreStaticallyKnowable(SILModule &M, SILDeclRef Decl) {
if (Decl.isForeign)
return false;
const DeclContext *AssocDC = M.getAssociatedContext();
if (!AssocDC)
return false;
auto *AFD = Decl.getAbstractFunctionDecl();
assert(AFD && "Expected abstract function decl!");
// Only handle members defined within the SILModule's associated context.
if (!AFD->isChildContextOf(AssocDC))
return false;
if (AFD->isDynamic())
return false;
if (!AFD->hasAccessibility())
return false;
// Only consider 'private' members, unless we are in whole-module compilation.
switch (AFD->getEffectiveAccess()) {
case Accessibility::Open:
return false;
case Accessibility::Public:
if (isa<ConstructorDecl>(AFD)) {
// Constructors are special: a derived class in another module can
// "override" a constructor if its class is "open", although the
// constructor itself is not open.
auto *ND = AFD->getDeclContext()
->getAsNominalTypeOrNominalTypeExtensionContext();
if (ND->getEffectiveAccess() == Accessibility::Open)
return false;
}
LLVM_FALLTHROUGH;
case Accessibility::Internal:
return M.isWholeModule();
case Accessibility::FilePrivate:
case Accessibility::Private:
return true;
}
llvm_unreachable("Unhandled Accessibility in switch.");
}
void swift::hoistAddressProjections(Operand &Op, SILInstruction *InsertBefore,
DominanceInfo *DomTree) {
SILValue V = Op.get();
SILInstruction *Prev = nullptr;
auto *InsertPt = InsertBefore;
while (true) {
SILValue Incoming = stripSinglePredecessorArgs(V);
// Forward the incoming arg from a single predecessor.
if (V != Incoming) {
if (V == Op.get()) {
// If we are the operand itself set the operand to the incoming
// argument.
Op.set(Incoming);
V = Incoming;
} else {
// Otherwise, set the previous projections operand to the incoming
// argument.
assert(Prev && "Must have seen a projection");
Prev->setOperand(0, Incoming);
V = Incoming;
}
}
switch (V->getKind()) {
case ValueKind::StructElementAddrInst:
case ValueKind::TupleElementAddrInst:
case ValueKind::RefElementAddrInst:
case ValueKind::RefTailAddrInst:
case ValueKind::UncheckedTakeEnumDataAddrInst: {
auto *Inst = cast<SILInstruction>(V);
// We are done once the current projection dominates the insert point.
if (DomTree->dominates(Inst->getParent(), InsertBefore->getParent()))
return;
// Move the current projection and memorize it for the next iteration.
Prev = Inst;
Inst->moveBefore(InsertPt);
InsertPt = Inst;
V = Inst->getOperand(0);
continue;
}
default:
assert(DomTree->dominates(V->getParentBlock(), InsertBefore->getParent()) &&
"The projected value must dominate the insertion point");
return;
}
}
}
| {
"content_hash": "ec1b7eb9f264828a72b81a912498c570",
"timestamp": "",
"source": "github",
"line_count": 2755,
"max_line_length": 90,
"avg_line_length": 35.58620689655172,
"alnum_prop": 0.652733578131375,
"repo_name": "manavgabhawala/swift",
"id": "f1f6c556a7a1808c3d01be30bf762412c70ca3f3",
"size": "98040",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/SILOptimizer/Utils/Local.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "2142"
},
{
"name": "C",
"bytes": "46856"
},
{
"name": "C++",
"bytes": "20300989"
},
{
"name": "CMake",
"bytes": "280965"
},
{
"name": "D",
"bytes": "1686"
},
{
"name": "DTrace",
"bytes": "1857"
},
{
"name": "Emacs Lisp",
"bytes": "39397"
},
{
"name": "LLVM",
"bytes": "59306"
},
{
"name": "Makefile",
"bytes": "1841"
},
{
"name": "Objective-C",
"bytes": "215465"
},
{
"name": "Objective-C++",
"bytes": "185332"
},
{
"name": "Perl",
"bytes": "2216"
},
{
"name": "Python",
"bytes": "537961"
},
{
"name": "Ruby",
"bytes": "2091"
},
{
"name": "Shell",
"bytes": "169905"
},
{
"name": "Swift",
"bytes": "14736731"
},
{
"name": "VimL",
"bytes": "13431"
}
],
"symlink_target": ""
} |
@implementation AMNotification
+(NSDictionary *)JSONKeyPathsByPropertyKey
{
return @{@"identifier" : @"id",
@"content" : @"content",
@"read" : @"read",
@"payload" : @"payload",
@"createdAt" : @"created_at"};
}
+(NSValueTransformer *)createdAtJSONTransformer
{
return [MTLValueTransformer reversibleTransformerWithForwardBlock:^(NSString *str) {
return [[NSDateFormatter sharedAirMenuFormatter] dateFromString:str];
} reverseBlock:^(NSDate *date) {
return [[NSDateFormatter sharedAirMenuFormatter] stringFromDate:date];
}];
}
-(BOOL)isEqual:(id)object
{
if(self.class == [object class]) {
return [self.identifier isEqualToNumber:[(AMNotification *)object identifier]] ||
(!self.identifier && ![(AMNotification *)object identifier]);
}
return NO;
}
-(NSUInteger)hash
{
return [self.identifier hash];
}
@end
| {
"content_hash": "1a4637bdafc898cfd0b7cb027f7fdea2",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 90,
"avg_line_length": 26.485714285714284,
"alnum_prop": 0.6407766990291263,
"repo_name": "brogrammers/air-menu-kit",
"id": "34f22022ab089497d938c735c396f720fe270762",
"size": "1141",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Classes/Models/AMNotification.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "515403"
},
{
"name": "Ruby",
"bytes": "778"
}
],
"symlink_target": ""
} |
set -euo pipefail
if [ -z "$COVERALLS_TOKEN" ]; then
echo "FAIL: Missing or empty COVERALLS_TOKEN."
exit 1
fi
if [ -z "$CODECOV_TOKEN" ]; then
echo "FAIL: Missing or empty CODECOV_TOKEN."
exit 1
fi
if [ -n "${TMPDIR-}" ]; then
outdir="${TMPDIR}"
else
outdir="/tmp"
fi
prefix="github.com/cockroachdb/cockroach/pkg"
# This regex removes files from the uploaded coverage.
ignore_files="$prefix/(acceptance|cmd|ui/embedded|storage/simulation|sql/pgbench|.*\.(pb|pb\.gw)\.go)"
coverage_dir="${outdir}/coverage"
coverage_profile="${coverage_dir}/coverage.out"
coverage_mode=count
# iterative_coverpkg fetches all test deps and main deps, filters them, and
# converts them into a comma separated list stored in $coverpkg.
iterative_coverpkg() {
local imports="$1"
local old_line_count="-1"
local line_count=""
while [ "$old_line_count" != "$line_count" ]; do
old_line_count=$line_count
imports+=$'\n'$(go list -f '{{join .Imports "\n"}}
{{join .TestImports "\n"}}
{{join .XTestImports "\n"}}' $imports | grep $prefix)
imports=$(echo "$imports" | sort | uniq)
line_count=$(echo $imports | wc -w)
done
coverpkg=$(echo $imports | sed 's/ /,/g')
}
rm -rf "$coverage_dir"
mkdir -p "$coverage_dir"
# Run "make coverage" on each package except for those in cmd.
for pkg in $(go list ./pkg/... | grep -vF 'pkg/cmd'); do
echo "Processing $pkg..."
# Verify package has test files.
if [ -z "$(go list -f '{{join .TestGoFiles ""}}{{join .XTestGoFiles ""}}' $pkg)" ]; then
echo "$pkg: Skipping due to no test files."
continue
fi
# Only generate coverage for cockroach dependencies.
iterative_coverpkg $pkg
# Find all cockroach packages that are imported by this package or in it's
# tests.
f="${coverage_dir}/$(echo $pkg | tr / -).cover"
touch $f
time make coverage \
PKG="$pkg" \
TESTFLAGS="-v -coverprofile=$f -covermode=$coverage_mode -coverpkg=$coverpkg" | \
tee "${outdir}/coverage.log"
done
# Merge coverage profiles and remove lines that match our ignore filter.
gocovmerge "$coverage_dir"/*.cover | grep -vE "$ignore_files" > "$coverage_profile"
# Upload profiles to coveralls.io.
goveralls \
-coverprofile="$coverage_profile" \
-service=teamcity \
-repotoken=$COVERALLS_TOKEN
# Upload profiles to codecov.io.
bash <(curl -s https://codecov.io/bash) -f "$coverage_profile"
| {
"content_hash": "f2f10868e797aee76d4b61a7a2951408",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 102,
"avg_line_length": 30.28205128205128,
"alnum_prop": 0.6701947502116851,
"repo_name": "petermattis/cockroach",
"id": "ab0aab5220ca82c44030c7823881fc74da935e1b",
"size": "2383",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "build/upload-coverage.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "1029"
},
{
"name": "C",
"bytes": "9260"
},
{
"name": "C++",
"bytes": "80578"
},
{
"name": "CSS",
"bytes": "37962"
},
{
"name": "Go",
"bytes": "8386033"
},
{
"name": "HCL",
"bytes": "34987"
},
{
"name": "HTML",
"bytes": "18016"
},
{
"name": "JavaScript",
"bytes": "261951"
},
{
"name": "Makefile",
"bytes": "20706"
},
{
"name": "Protocol Buffer",
"bytes": "222568"
},
{
"name": "Ruby",
"bytes": "2554"
},
{
"name": "Shell",
"bytes": "49022"
},
{
"name": "Smarty",
"bytes": "4831"
},
{
"name": "Tcl",
"bytes": "23649"
},
{
"name": "TypeScript",
"bytes": "298817"
},
{
"name": "Vim script",
"bytes": "1650"
},
{
"name": "Yacc",
"bytes": "128577"
}
],
"symlink_target": ""
} |
namespace stde = std::experimental;
struct random_state {
int next_value;
friend bool operator==(random_state lhs, random_state rhs) {
return lhs.next_value == rhs.next_value;
}
};
template <typename R, typename... A>
struct OneShotFunction {
struct IInvoker {
virtual ~IInvoker() = default;
virtual R invoke(A...) && = 0;
};
template <typename F>
struct Invoker : IInvoker {
F f;
template <typename G>
Invoker(G&& f) : f(std::forward<G>(f)) {}
R invoke(A... args) && override { return std::move(f)(args...); }
};
std::shared_ptr<IInvoker> invoker;
template <typename F>
OneShotFunction(F&& f)
: invoker(std::make_shared<Invoker<std::remove_cvref_t<F>>>(
std::forward<F>(f))) {}
auto operator()(A... args) && { return std::move(*invoker).invoke(args...); }
};
struct OneShotFunctionTC {
template <typename R, typename... A>
using invoke = OneShotFunction<R, A...>;
};
struct StdFunctionTC {
template <typename R, typename... A>
using invoke = std::function<R(A...)>;
};
namespace std::experimental::type_constructible {
template <>
struct traits<StdFunctionTC> {
template <typename R, typename... A, typename F>
static auto make(F&& f) {
return std::function<R(A...)>(std::forward<F>(f));
}
};
} // namespace std::experimental::type_constructible
using MyState = toby::state::StateTC<StdFunctionTC, random_state>;
using MyStateOneShot = toby::state::StateTC<OneShotFunctionTC, random_state>;
auto random(random_state s) -> std::pair<double, random_state> {
return {static_cast<double>(s.next_value), {s.next_value + 1}};
}
MyState::t<double> const next_random = MyState::get >>= [](auto&& rs) {
auto _ = random(rs);
auto&& v = _.first;
auto&& rs2 = _.second;
return MyState::put(rs2) >>= [=](auto&&) { return MyState::pure(v); };
};
auto const next_random_co = []() -> MyStateOneShot::t<double> {
auto rs = co_await MyState::get;
auto [v, rs2] = random(rs);
auto _ = co_await MyState::put(rs2);
co_return v;
};
TEST_CASE("pure raw") {
auto r = toby::state::pure(2.3).run(random_state{7});
CHECK(r.data == 2.3);
CHECK(r.state == random_state{7});
}
TEST_CASE("pure type-erased") {
auto r = MyState::pure(2.3).run({7});
CHECK(r.data == 2.3);
CHECK(r.state == random_state{7});
}
TEST_CASE("get raw") {
CHECK(std::is_const_v<decltype(toby::state::get)>);
auto r = toby::state::get.run(random_state{7});
CHECK(r.data == random_state{7});
CHECK(r.state == random_state{7});
}
TEST_CASE("get type-erased") {
auto r = MyState::get.run({7});
CHECK(r.data == random_state{7});
CHECK(r.state == random_state{7});
}
TEST_CASE("put raw") {
auto r = toby::state::put(random_state{42}).run(random_state{7});
CHECK(r.data == toby::state::unit{});
CHECK(r.state == random_state{42});
}
TEST_CASE("put type-erased") {
auto r = MyState::put(random_state{42}).run({7});
CHECK(r.data == toby::state::unit{});
CHECK(r.state == random_state{42});
}
TEST_CASE("fmap raw") {
auto st = toby::state::pure(4.2);
auto st2 =
toby::state::transform(st, [](auto x) { return std::to_string(x); });
auto r = st2.run(7);
CHECK(r.data == std::to_string(4.2));
CHECK(r.state == 7);
}
TEST_CASE("fmap type-erased") {
auto st = toby::state::StateTC<StdFunctionTC, int>::pure(4.2);
auto st2 =
stde::functor::transform(st, [](auto x) { return std::to_string(x); });
auto r = st2.run(7);
CHECK(r.data == std::to_string(4.2));
CHECK(r.state == 7);
}
TEST_CASE("next_random") {
auto r = next_random.run({7});
CHECK(r.data == 7.0);
CHECK(r.state == random_state{8});
}
TEST_CASE("next_random transform") {
auto st =
stde::functor::transform(next_random, [](auto&& arg) { return arg * 2; });
auto r = st.run({7});
CHECK(r.data == 14.0);
CHECK(r.state == random_state{8});
}
TEST_CASE("next_random_co") {
auto st = next_random_co();
auto r = std::move(st).run({7});
CHECK(r.data == 7.0);
CHECK(r.state == random_state{8});
// check that creating it again is independent
auto st2 = next_random_co();
r = std::move(st2).run({8});
CHECK(r.data == 8.0);
CHECK(r.state == random_state{9});
}
TEST_CASE("next_random_co transform") {
auto st = stde::functor::transform(next_random_co(),
[](auto&& arg) { return arg * 2; });
auto r = std::move(st).run({7});
CHECK(r.data == 14.0);
CHECK(r.state == random_state{8});
}
TEST_CASE("running a coroutine-based state twice throws an exception") {
auto st = next_random_co();
auto r = std::move(st).run({7});
CHECK_THROWS(std::move(st).run({7}));
}
TEST_CASE("next_random_thrice") {
auto st = next_random >>= [](auto x) {
return next_random >>= [=](auto y) {
return next_random >>= [=](auto z) {
return MyState::pure(std::tuple{x, y, z});
};
};
};
auto r = st.run({7});
CHECK(r.data == std::make_tuple(7.0, 8.0, 9.0));
CHECK(r.state == random_state{10});
}
TEST_CASE("next_random_co_thrice") {
auto st = []() -> MyStateOneShot::t<std::tuple<double, double, double>> {
auto x = co_await next_random_co();
auto y = co_await next_random_co();
auto z = co_await next_random_co();
co_return std::make_tuple(x, y, z);
}();
auto r = std::move(st).run({7});
CHECK(r.data == std::make_tuple(7.0, 8.0, 9.0));
CHECK(r.state == random_state{10});
}
| {
"content_hash": "c0f9ca0adaa3d8d34e36fe7a22195f9b",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 80,
"avg_line_length": 27.282828282828284,
"alnum_prop": 0.5999629766753054,
"repo_name": "toby-allsopp/coroutine_monad",
"id": "3fe9b8d679d73fcdada4a23bd1e7f4911ba6f956",
"size": "5444",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test_state.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "447824"
},
{
"name": "CMake",
"bytes": "974"
},
{
"name": "Emacs Lisp",
"bytes": "194"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.