code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
<h1>Themes</h1> <h3 class="md-title">Custom Themes</h3> <p>You can create your custom theme. You can copy and modify the predefined theme Vintage Polaroid. </p> <h3 class="md-title">Create customized palletes</h3> <p>Use the resource below to generate your own customized color palletes:</p> <code>https://angular-md-color.com/#/</code> <p> If you need more custom styling (such as layout changes including padding, margins, etc) you will need to either write CSS rules with custom selectors, or build a custom version of the angular-material.css file using SASS and custom variables.</p>
Miki-AG/ngLaunchpad
v0.1/layouts/grid/ng/app/pages/themes.custom.tpl.html
HTML
mit
597
import tensorflow as tf from .network import Network from ..fast_rcnn.config import cfg class VGGnet_testold(Network): def __init__(self, trainable=True): self.inputs = [] self.data = tf.placeholder(tf.float32, shape=[None, None, None, 3]) self.im_info = tf.placeholder(tf.float32, shape=[None, 3]) self.keep_prob = tf.placeholder(tf.float32) self.layers = dict({'data':self.data, 'im_info':self.im_info}) self.trainable = trainable self.setup() def setup(self): # n_classes = 21 n_classes = cfg.NCLASSES # anchor_scales = [8, 16, 32] anchor_scales = cfg.ANCHOR_SCALES _feat_stride = [16, ] (self.feed('data') .conv(3, 3, 64, 1, 1, name='conv1_1', trainable=False) .conv(3, 3, 64, 1, 1, name='conv1_2', trainable=False) .max_pool(2, 2, 2, 2, padding='VALID', name='pool1') .conv(3, 3, 128, 1, 1, name='conv2_1', trainable=False) .conv(3, 3, 128, 1, 1, name='conv2_2', trainable=False) .max_pool(2, 2, 2, 2, padding='VALID', name='pool2') .conv(3, 3, 256, 1, 1, name='conv3_1') .conv(3, 3, 256, 1, 1, name='conv3_2') .conv(3, 3, 256, 1, 1, name='conv3_3') .max_pool(2, 2, 2, 2, padding='VALID', name='pool3') .conv(3, 3, 512, 1, 1, name='conv4_1') .conv(3, 3, 512, 1, 1, name='conv4_2') .conv(3, 3, 512, 1, 1, name='conv4_3') .max_pool(2, 2, 2, 2, padding='VALID', name='pool4') .conv(3, 3, 512, 1, 1, name='conv5_1') .conv(3, 3, 512, 1, 1, name='conv5_2') .conv(3, 3, 512, 1, 1, name='conv5_3')) (self.feed('conv5_3') .conv(3,3,512,1,1,name='rpn_conv/3x3') .conv(1,1,len(anchor_scales)*3*2,1,1,padding='VALID',relu = False,name='rpn_cls_score')) # (1, H, W, A x 2) (self.feed('rpn_conv/3x3') .conv(1,1,len(anchor_scales)*3*4,1,1,padding='VALID',relu = False,name='rpn_bbox_pred')) (self.feed('rpn_cls_score') .reshape_layer(2,name = 'rpn_cls_score_reshape') # (1, AxH, W, 2) .softmax(name='rpn_cls_prob')) # (1, AxH, W, 2) (self.feed('rpn_cls_prob') .reshape_layer(len(anchor_scales)*3*2,name = 'rpn_cls_prob_reshape')) # (1, H, W, 2xA)!! (self.feed('rpn_cls_prob_reshape','rpn_bbox_pred','im_info') .proposal_layer(_feat_stride, anchor_scales, 'TEST', name = 'rois')) (self.feed('conv5_3', 'rois') .roi_pool(7, 7, 1.0/16, name='pool_5') .fc(4096, name='fc6') .fc(4096, name='fc7') .fc(n_classes, relu=False, name='cls_score') .softmax(name='cls_prob')) (self.feed('fc7') .fc(n_classes*4, relu=False, name='bbox_pred'))
CharlesShang/TFFRCNN
lib/networks/VGGnet_testold.py
Python
mit
2,897
import { Component, ChangeDetectionStrategy } from '@angular/core'; import { DataService, Atom } from '../data.service'; import { Observable } from 'rxjs'; import { Column } from 'ng2-qgrid'; const EXAMPLE_TAGS = [ 'define-column-type', 'Column type can be defined in typescript' ]; @Component({ selector: 'example-define-column-type', templateUrl: 'example-define-column-type.component.html', styleUrls: ['example-define-column-type.component.scss'], providers: [DataService], changeDetection: ChangeDetectionStrategy.OnPush }) export class ExampleDefineColumnTypeComponent { static tags = EXAMPLE_TAGS; title = EXAMPLE_TAGS[1]; rows: Observable<Atom[]>; columns: Column[] = [{ key: 'number', type: 'number' }, { key: 'symbol', type: 'number' }]; constructor(dataService: DataService) { this.rows = dataService.getAtoms(); } }
azkurban/ng2
src/examples/define-column-type/example-define-column-type.component.ts
TypeScript
mit
857
/* * The Computer Language Benchmarks Game * http://benchmarksgame.alioth.debian.org/ * contributed by Rex Kerr * based on version by John Nilsson as modified by Geoff Reedy */ object pidigits { type I = BigInt import BigInt._ class LFT(q:I, r:I, t:I) { def compose(k: Int) = new LFT(q*k, (q*(4*k+2))+(r*(2*k+1)), t*(2*k+1)) def extract = { val (y,rem) = (q*3 + r) /% t if((rem + q) < t) Some(y.intValue) else None } def next(y: Int) = new LFT(q*10, (r-(t*y))*10, t) } def pi_digits = { def digits(z: LFT, k: Int): Stream[Int] = z extract match { case Some(y) => Stream.cons(y,digits(z next y,k)) case None => digits(z compose k,k+1) } digits(new LFT(1,0,1),1) } def by[T](s: Stream[T], n: Int): Stream[Stream[T]] = if (s.isEmpty) Stream.empty else Stream.cons(s take n, by(s drop n, n)) def main(args: Array[String]): Unit = for ((d,n) <- by(pi_digits take args(0).toInt, 10).zipWithIndex) printf("%-10s\t:%d\n",d.mkString,10*n+d.length) }
dc-uba/metrika_benchs_game
benchs/pidigits/pidigits.scala-3.scala
Scala
mit
1,044
using System; using System.Drawing; using System.Windows.Forms; using LiveCharts; using LiveCharts.Wpf; namespace Winforms.Cartesian.Customized_Series { public partial class CustomizedSeries : Form { public CustomizedSeries() { InitializeComponent(); } private void CustomizedLineSeries_Load(object sender, EventArgs e) { cartesianChart1.Series.Add(new LineSeries { Values = new ChartValues<double> { 3, 4, 6, 3, 2, 6 }, StrokeThickness = 4, StrokeDashArray = new System.Windows.Media.DoubleCollection(new double[] { 2 }), Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(107, 185, 69)), Fill = System.Windows.Media.Brushes.Transparent, LineSmoothness = 0, PointGeometrySize = 0 }); cartesianChart1.Series.Add(new LineSeries { Values = new ChartValues<double> { 5, 3, 5, 7, 3, 9 }, StrokeThickness = 2, Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(28, 142, 196)), Fill = System.Windows.Media.Brushes.Transparent, LineSmoothness = 1, PointGeometrySize = 15, PointForeground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(34, 46, 49)) }); cartesianChart1.Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(34, 46, 49)); cartesianChart1.AxisX.Add(new Axis { IsMerged = true, Separator = new Separator { StrokeThickness = 1, StrokeDashArray = new System.Windows.Media.DoubleCollection(new double[] { 2 }), Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(64, 79, 86)) } }); cartesianChart1.AxisY.Add(new Axis { IsMerged = true, Separator = new Separator { StrokeThickness = 1.5, StrokeDashArray = new System.Windows.Media.DoubleCollection(new double[] { 4 }), Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(64, 79, 86)) } }); } } }
beto-rodriguez/Live-Charts
Examples/WinForms/Cartesian/Customized Series/Customized Line Series.cs
C#
mit
2,575
<html> <META HTTP-EQUIV=Content-Type Content="text/html; charset=big5"> <!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/04712/0471289062700.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:25:59 GMT --> <head><title>ªk½s¸¹:04712 ª©¥»:089062700</title> <link rel="stylesheet" type="text/css" href="../../version.css" > </HEAD> <body><left> <table><tr><td><FONT COLOR=blue SIZE=5>¤½Â¾¤H­û§Q¯q½Ä¬ð°jÁתk(04712)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td> <table><tr><td>&nbsp;&nbsp;&nbsp;</td> <tr><td align=left valign=top> <a href=0471289062700.html target=law04712><nobr><font size=2>¤¤µØ¥Á°ê 89 ¦~ 6 ¤ë 27 ¤é</font></nobr></a> </td> <td valign=top><font size=2>¨î©w24±ø</font></td> <tr><td align=left valign=top><nobr><font size=2>¤¤µØ¥Á°ê 89 ¦~ 7 ¤ë 12 ¤é¤½¥¬</font></nobr></td> </table></table></table></table> <p><table><tr><td><font color=blue size=4>¥Á°ê89¦~6¤ë27¤é</font></td> <td><a href=http://lis.ly.gov.tw/lghtml/lawstat/reason2/0471289062700.htm target=reason><font size=2>¥ßªk²z¥Ñ</font></a></td> <td><a href=http://lis.ly.gov.tw/lgcgi/lglawproc?0471289062700 target=proc><font size=2>¥ßªk¬ö¿ý</font></a></td> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤@±ø</font> &nbsp;&nbsp;<font size=2>(¥ßªk¥Øªº)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¬°«P¶i·G¯à¬Fªv¡BºÝ¥¿¬Fªv­·®ð¡A«Ø¥ß¤½Â¾¤H­û§Q¯q½Ä¬ð°jÁפ§³W½d¡A¦³®Ä¹Kªý³g¦Ã»G¤Æº[¤£·í§Q¯q¿é°e¡A¯S¨î©w¥»ªk¡C<br> ¡@¡@¤½Â¾¤H­û§Q¯q½Ä¬ð¤§°jÁסA°£¨ä¥Lªk«ß¥t¦³ÄY®æ³W©wªÌ¥~¡A¾A¥Î¥»ªk¤§³W©w¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G±ø</font> &nbsp;&nbsp;<font size=2>(¤½Â¾¤H­û¤§½d³ò)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»ªk©ÒºÙ¤½Â¾¤H­û¡A«ü¤½Â¾¤H­û°]²£¥Ó³øªk²Ä¤G±ø²Ä¤@¶µ©Ò©w¤§¤H­û¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤T±ø</font> &nbsp;&nbsp;<font size=2>(¤½Â¾¤H­ûÃö«Y¤H¤§½d³ò)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»ªk©Ò©w¤½Â¾¤H­û¤§Ãö«Y¤H¡A¨ä½d³ò¦p¤U¡G<br> ¡@¡@¤@¡B¤½Â¾¤H­û¤§°t°¸©Î¦@¦P¥Í¬¡¤§®aÄÝ¡C<br> ¡@¡@¤G¡B¤½Â¾¤H­û¤§¤G¿Ëµ¥¥H¤º¿ËÄÝ¡C<br> ¡@¡@¤T¡B¤½Â¾¤H­û©Î¨ä°t°¸«H°U°]²£¤§¨ü°U¤H¡C<br> ¡@¡@¥|¡B¤½Â¾¤H­û¡B²Ä¤@´Ú¤Î²Ä¤G´Ú©Ò¦C¤H­û¾á¥ô­t³d¤H¡B¸³¨Æ¡BºÊ¹î¤H©Î¸g²z¤H¤§Àç§Q¨Æ·~¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¥|±ø</font> &nbsp;&nbsp;<font size=2>(§Q¯q¤§©w¸q)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»ªk©ÒºÙ§Q¯q¡A¥]¬A°]²£¤W§Q¯q¤Î«D°]²£¤W§Q¯q¡C<br> ¡@¡@°]²£¤W§Q¯q¦p¤U¡G<br> ¡@¡@¤@¡B°Ê²£¡B¤£°Ê²£¡C<br> ¡@¡@¤G¡B²{ª÷¡B¦s´Ú¡B¥~¹ô¡B¦³»ùÃÒ¨é¡C<br> ¡@¡@¤T¡B¶ÅÅv©Î¨ä¥L°]²£¤WÅv§Q¡C<br> ¡@¡@¥|¡B¨ä¥L¨ã¦³¸gÀÙ»ù­È©Î±o¥Hª÷¿ú¥æ©ö¨ú±o¤§§Q¯q¡C<br> ¡@¡@«D°]²£¤W§Q¯q¡A«ü¦³§Q¤½Â¾¤H­û©Î¨äÃö«Y¤H©ó¬F©²¾÷Ãö¡B¤½¥ß¾Ç®Õ¡B¤½Àç¨Æ·~¾÷ºc¡]¥H¤U²ºÙ¾÷Ãö¡^¤§¥ô¥Î¡B°¥¾E¡B½Õ°Ê¤Î¨ä¥L¤H¨Æ±¹¬I¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤­±ø</font> &nbsp;&nbsp;<font size=2>(§Q¯q½Ä¬ð¤§©w¸q)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»ªk©ÒºÙ§Q¯q½Ä¬ð¡A«ü¤½Â¾¤H­û°õ¦æÂ¾°È®É¡A±o¦]¨ä§@¬°©Î¤£§@¬°¡Aª½±µ©Î¶¡±µ¨Ï¥»¤H©Î¨äÃö«Y¤HÀò¨ú§Q¯qªÌ¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤»±ø</font> &nbsp;&nbsp;<font size=2>(¦Û¦æ°jÁ×)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¤½Â¾¤H­ûª¾¦³§Q¯q½Ä¬ðªÌ¡AÀ³§Y¦Û¦æ°jÁסC<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤C±ø</font> &nbsp;&nbsp;<font size=2>(¤£·í§Q¯q¤§¸T¤î¡Ð°²­É¾Åv)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¤½Â¾¤H­û¤£±o°²­É¾°È¤W¤§Åv¤O¡B¾÷·|©Î¤èªk¡A¹Ï¨ä¥»¤H©ÎÃö«Y¤H¤§§Q¯q¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤K±ø</font> &nbsp;&nbsp;<font size=2>(¤£·í§Q¯q¤§¸T¤î¡ÐÃö»¡½Ð°U)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¤½Â¾¤H­û¤§Ãö«Y¤H¤£±o¦V¾÷Ãö¦³Ãö¤H­ûÃö»¡¡B½Ð°U©Î¥H¨ä¥L¤£·í¤èªk¡A¹Ï¨ä¥»¤H©Î¤½Â¾¤H­û¤§§Q¯q¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤E±ø</font> &nbsp;&nbsp;<font size=2>(¤£·í§Q¯q¤§¸T¤î¡Ð¥æ©ö¦æ¬°)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¤½Â¾¤H­û©Î¨äÃö«Y¤H¡A¤£±o»P¤½Â¾¤H­ûªA°È¤§¾÷Ãö©Î¨ü¨äºÊ·þ¤§¾÷Ãö¬°¶R½æ¡B¯²¸î¡B©ÓÅóµ¥¥æ©ö¦æ¬°¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q±ø</font> &nbsp;&nbsp;<font size=2>(¦³°jÁ׸q°È¤§³B²z)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¤½Â¾¤H­ûª¾¦³°jÁ׸q°ÈªÌ¡AÀ³¨Ì¤U¦C³W©w¿ì²z¡G<br> ¡@¡@¤@¡B¥Á·N¥Nªí¡A¤£±o°Ñ»P­Ó¤H§Q¯q¬ÛÃöij®×¤§¼fij¤Îªí¨M¡C<br> ¡@¡@¤G¡B¨ä¥L¤½Â¾¤H­ûÀ³°±¤î°õ¦æ¸Ó¶µÂ¾°È¡A¨Ã¥Ñ¾°È¥N²z¤H°õ¦æ¤§¡C<br> ¡@¡@«e¶µ±¡§Î¡A¤½Â¾¤H­ûÀ³¥H®Ñ­±¤À§O¦V¤½Â¾¤H­û°]²£¥Ó³øªk²Ä¥|±ø©Ò©w¾÷Ãö³ø³Æ¡C<br> ¡@¡@²Ä¤@¶µ¤§±¡§Î¡A¤½Â¾¤H­û¤§ªA°È¾÷Ãö©Î¤W¯Å¾÷Ãö¦p»{¸Ó¤½Â¾¤H­ûµL¶·°jÁת̡A±o©R¨äÄ~Äò°õ¦æÂ¾°È¡C<br> ¡@¡@ªA°È¾÷Ãö©Î¤W¯Å¾÷Ãöª¾¦³À³¦Û¦æ°jÁצӥ¼°jÁ×±¡¨ÆªÌ¡AÀ³©R¸Ó¤½Â¾¤H­û°jÁסC<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤@±ø</font> &nbsp;&nbsp;<font size=2>(¦Û¦æ°jÁ׫e©Ò¬°¦æ¬°µL®Ä)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥Á·N¥Nªí¥H¥~¤§¤½Â¾¤H­û©ó¦Û¦æ°jÁ׫e¡A¹ï¸Ó¶µ¨Æ°È©Ò¬°¤§¦P·N¡B§_¨M¡B¨M©w¡B«ØÄ³¡B´£®×¡B½Õ¬dµ¥¦æ¬°§¡ÄݵL®Ä¡AÀ³¥Ñ¨ä¾°È¥N²z¤H­«·s¬°¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤G±ø</font> &nbsp;&nbsp;<font size=2>(¥Ó½Ð°jÁ×)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¤½Â¾¤H­û¦³À³¦Û¦æ°jÁפ§±¡¨Æ¦Ó¤£°jÁת̡A§Q®`Ãö«Y¤H±o¦V¤U¦C¾÷Ãö¥Ó½Ð¨ä°jÁסG<br> ¡@¡@¤@¡BÀ³°jÁת̬°¥Á·N¥Nªí®É¡A¦V¦U¸Ó¥Á·N¾÷Ãö¬°¤§¡C<br> ¡@¡@¤G¡BÀ³°jÁת̬°¨ä¥L¤½Â¾¤H­û®É¡A¦V¸Ó¤½Â¾¤H­ûªA°È¾÷Ãö¬°¤§¡F¦p¬°¾÷Ãö­ºªø®É¡A¦V¤W¯Å¾÷Ãö¬°¤§¡FµL¤W¯Å¾÷ÃöªÌ¡A¦VºÊ¹î°|¬°¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤T±ø</font> &nbsp;&nbsp;<font size=2>(±j¨î°jÁ×)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@«e±ø¤§¥Ó½Ð¡A¸g½Õ¬dÄݹê«á¡AÀ³©R³Q¥Ó½Ð°jÁפ§¤½Â¾¤H­û°jÁסA¸Ó¤½Â¾¤H­û¤£±o©Úµ´¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¥|±ø</font> &nbsp;&nbsp;<font size=2>(»@«h)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¹H¤Ï²Ä¤C±ø©Î²Ä¤K±ø³W©wªÌ¡A³B·s»O¹ô¤@¦Ê¸U¤¸¥H¤W¤­¦Ê¸U¤¸¥H¤U»@Áì¡F©Ò±o°]²£¤W§Q¯q¡AÀ³¤©°lú¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤­±ø</font> &nbsp;&nbsp;<font size=2>(»@«h)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¹H¤Ï²Ä¤E±ø³W©wªÌ¡A³B¸Ó¥æ©ö¦æ¬°ª÷ÃB¤@­¿¦Ü¤T­¿¤§»@Áì¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤»±ø</font> &nbsp;&nbsp;<font size=2>(»@«h)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¹H¤Ï²Ä¤Q±ø²Ä¤@¶µ³W©wªÌ¡A³B·s»O¹ô¤@¦Ê¸U¤¸¥H¤W¤­¦Ê¸U¤¸¥H¤U»@Áì¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤C±ø</font> &nbsp;&nbsp;<font size=2>(»@«h)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¤½Â¾¤H­û¹H¤Ï²Ä¤Q±ø²Ä¥|¶µ©Î²Ä¤Q¤T±ø³W©w©Úµ´°jÁת̡A³B·s»O¹ô¤@¦Ê¤­¤Q¸U¤¸¥H¤W¤C¦Ê¤­¤Q¸U¤¸¥H¤U»@Áì¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤K±ø</font> &nbsp;&nbsp;<font size=2>(³sÄò³B»@)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¨Ì«e¤G±ø³B»@«á¦A¹H¤ÏªÌ¡A³sÄò³B»@¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤Q¤E±ø</font> &nbsp;&nbsp;<font size=2>(³B»@¤§¾÷Ãö)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»ªk©Ò©w¤§»@Áì¡A¥Ñ¤U¦C¾÷Ãö¬°¤§¡G<br> ¡@¡@¤@¡B¨Ì¤½Â¾¤H­û°]²£¥Ó³øªk²Ä¤G±ø²Ä¤@¶µ³W©wÀ³¦VºÊ¹î°|¥Ó³ø°]²£¤§¤H­û¡A¥ÑºÊ¹î°|¬°¤§¡C<br> ¡@¡@¤G¡B¤½Â¾¤H­û¤§Ãö«Y¤H¤Î«e´Ú¥H¥~¤§¤½Â¾¤H­û¡A¥Ñªk°È³¡¬°¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G¤Q±ø</font> &nbsp;&nbsp;<font size=2>(±j¨î°õ¦æ)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¨Ì¥»ªk©Ò³B¤§»@Áì¡A¸g­­´Áú¯Ç¦Ó©¡´Á¤£Ãº¯ÇªÌ¡A²¾°eªk°|±j¨î°õ¦æ¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G¤Q¤@±ø</font> &nbsp;&nbsp;<font size=2>(¯A¤Î¨ä¥Lªk«ß³d¥ô¤§³B²z)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¹H¤Ï¥»ªk³W©w¦Ó¯A¤Î¨ä¥Lªk«ß³d¥ôªÌ¡A¨Ì¦³Ãöªk«ß³B²z¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G¤Q¤G±ø</font> &nbsp;&nbsp;<font size=2>(¤½¶}³B¤À)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¨Ì¥»ªk»@Áì½T©wªÌ¡A¥Ñ³B¤À¾÷Ãö¤½¶}©ó¸ê°Tºô¸ô©Î¥Zµn¬F©²¤½³ø©Î·s»D¯È¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G¤Q¤T±ø</font> &nbsp;&nbsp;<font size=2>(¬I¦æ²Ó«h)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»ªk¬I¦æ²Ó«h¥Ñ¦æ¬F°|·|¦P¦Ò¸Õ°|¡BºÊ¹î°|©w¤§¡C<br> </td> </table> </table> </table> <table><tr><td>&nbsp;&nbsp;&nbsp;</td><td><font color=8000ff>²Ä¤G¤Q¥|±ø</font> &nbsp;&nbsp;<font size=2>(¬I¦æ¤é)</font> <table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td> ¡@¡@¥»ªk¦Û¤½¥¬¤é¬I¦æ¡C<br> </td> </table> </table> </table> </left> </body> <!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/04712/0471289062700.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:25:59 GMT --> </html>
g0v/laweasyread-data
rawdata/lawstat/version2/04712/0471289062700.html
HTML
mit
9,448
var expect = require('chai').expect; var cytoscape = require('../src', cytoscape); describe('Events', function(){ var cy; var n1; var triggers; // test setup beforeEach(function(done){ cytoscape({ styleEnabled: true, elements: { nodes: [ { data: { id: "n1", foo: "one", } }, { data: { id: "n2", foo: "two", } }, { data: { id: "n3", foo: "three", } }, { data: { id: "n4" } }, { data: { id: "n5", parent: 'n4' } }, ], edges: [ { data: { id: "n1n2", source: "n1", target: "n2", weight: 0.33 }, classes: "uh" }, { data: { id: "n2n3", source: "n2", target: "n3", weight: 0.66 }, classes: "huh" } ] }, ready: function(){ cy = this; n1 = cy.$('#n1'); triggers = 0; done(); } }); }); afterEach(function(){ cy.destroy(); }); describe('Collection events triggered by functions', function(){ var handler = function(){ triggers++; } it('`add` for new element', function(){ cy.on('add', handler); cy.add({ group: 'nodes', data: { id: 'foo' } }); expect( triggers ).to.equal(1); }); it('`add` for restored element', function(){ n1.on('add', handler); n1.remove(); n1.restore(); expect( triggers ).to.equal(1); }); it('`remove`', function(){ n1.on('remove', handler); n1.remove(); expect( triggers ).to.equal(1); }); it('`select`', function(){ n1.on('select', handler); n1.select(); expect( triggers ).to.equal(1); }); it('`unselect`', function(){ n1.on('unselect', handler); n1.select(); // make sure it's already selected n1.unselect(); expect( triggers ).to.equal(1); }); it('`lock`', function(){ n1.on('lock', handler); n1.lock(); expect( triggers ).to.equal(1); }); it('`unlock`', function(){ n1.on('unlock', handler); n1.lock(); // make sure it's already locked n1.unlock(); expect( triggers ).to.equal(1); }); it('`position`', function(){ n1.on('position', handler); n1.position({ x: 100, y: 100 }); expect( triggers ).to.equal(1); }); it('`data`', function(){ n1.on('data', handler); n1.data({ foo: 'bar' }); expect( triggers ).to.equal(1); }); it('`style`', function(){ n1.on('style', handler); n1.css({ 'background-color': 'red' }); expect( triggers ).to.equal(1); }); }); describe('Graph events triggered by functions', function(){ var triggers = 0; var handler = function(){ triggers++; } beforeEach(function(){ triggers = 0; }); it('`layoutstart`, `layoutready`, & `layoutstop`', function(done){ var start, ready; cy.on('layoutstart', function(){ start = true; }); cy.on('layoutready', function(){ ready = true; }); cy.on('layoutstop', function(){ expect( start ).to.be.true; expect( ready ).to.be.true; done(); }); cy.layout({ name: 'null' }); }); it('`load` & `done`', function(done){ cy.on('load', handler); cy.on('done', function(){ expect( triggers ).to.equal(1); done(); }); cy.load([ { group: 'nodes', data: { id: 'foo' } } ]); }); it('`pan`', function(){ cy.on('pan', handler); cy.pan({ x: 100, y: 100 }); expect( triggers ).to.equal(1); }); it('`zoom`', function(){ cy.on('zoom', handler); cy.zoom(2); expect( triggers ).to.equal(1); }); }); describe('Event bubbling', function(){ it('should bubble from child to parent node', function(){ var childTrigger, parentTrigger; var child = cy.$('#n5'); var parent = cy.$('#n4'); child.on('foo', function(){ childTrigger = true; }); parent.on('foo', function(){ parentTrigger = true; }); child.trigger('foo'); expect( childTrigger ).to.be.true; expect( parentTrigger ).to.be.true; }); it('should bubble from parent node to the core', function(){ var childTrigger, parentTrigger, coreTrigger; var child = cy.$('#n5'); var parent = cy.$('#n4'); child.on('foo', function(){ childTrigger = true; }); parent.on('foo', function(){ parentTrigger = true; }); cy.on('foo', function(){ coreTrigger = true; }); child.trigger('foo'); expect( childTrigger ).to.be.true; expect( parentTrigger ).to.be.true; expect( coreTrigger ).to.be.true; }); it('should bubble from lone node to core', function(){ var nodeTrigger, coreTrigger; var node = cy.$('#n1'); node.on('foo', function(){ nodeTrigger = true; }); cy.on('foo', function(){ coreTrigger = true; }); node.trigger('foo'); expect( nodeTrigger ).to.be.true; expect( coreTrigger ).to.be.true; }); }); describe('cy.on()', function(){ it('binds to one event', function(done){ cy .on('foo', function(){ done(); }) .trigger('foo') ; }); it('binds to multiple events', function(done){ var triggeredFoo = false; var triggeredBar = false; var triggers = 0; cy .on('foo bar', function(e){ if( e.type === 'foo' ){ triggeredFoo = true; } else if( e.type === 'bar' ){ triggeredBar = true; } triggers++; if( triggers === 2 ){ expect( triggeredFoo ).to.be.true; expect( triggeredBar ).to.be.true; done(); } }) .trigger('foo') .trigger('bar') ; }); it('binds with a selector', function(done){ cy.on('foo', 'node', function(e){ done(); }); cy.$('#n1').trigger('foo'); }); it('binds with data', function(done){ cy.on('foo', { bar: 'baz' }, function(e){ expect( e ).to.have.property('data'); expect( e.data ).to.have.property('bar', 'baz'); done(); }); cy.trigger('foo'); }); it('binds with an event map', function(){ var triggers = 0; cy.on({ 'foo': function(){ triggers++; }, 'bar': function(){ triggers++; } }); cy.trigger('foo bar'); expect( triggers ).to.equal(2); }); it('has event object structure', function(done){ cy .on('foo.bar', function(e){ expect( e ).to.be.ok; expect( e ).to.have.property('type', 'foo'); expect( e ).to.have.property('cy', cy); expect( e ).to.have.property('cyTarget', cy); expect( e ).to.have.property('namespace', '.bar'); expect( e.timeStamp ).to.be.a('number'); done(); }) .trigger('foo.bar') ; }); }); describe('cy.one()', function(){ it('only triggers once', function(){ var triggers = 0; cy.one('foo', function(e){ triggers++; }); cy.trigger('foo'); expect( triggers ).to.equal(1); cy.trigger('foo'); expect( triggers ).to.equal(1); }); it('triggers once with selector', function(){ var triggers = 0; cy.one('foo', 'node', function(e){ triggers++; }); cy.$('#n1').trigger('foo'); expect( triggers ).to.equal(1); cy.$('#n1').trigger('foo'); expect( triggers ).to.equal(1); }); it('triggers once with map', function(){ var triggers = 0; cy.one({ 'foo': function(e){ triggers++; } }); cy.trigger('foo'); expect( triggers ).to.equal(1); cy.trigger('foo'); expect( triggers ).to.equal(1); }); }); describe('cy.off()', function(){ it('removes a handler from .on()', function(){ var triggers = 0; var handler; cy.on('foo', handler = function(){ triggers++; }); cy.off('foo', handler); cy.trigger('foo'); expect( triggers ).to.equal(0); }); it('removes a handler from .one()', function(){ var triggers = 0; var handler; cy.one('foo', handler = function(){ triggers++; }); cy.off('foo', handler); cy.trigger('foo'); expect( triggers ).to.equal(0); }); it('removes a handler via just event type', function(){ var triggers = 0; var handler; cy.on('foo', handler = function(){ triggers++; }); cy.off('foo'); cy.trigger('foo'); expect( triggers ).to.equal(0); }); it('removes a handler via events map', function(){ var triggers = 0; var handler; cy.on('foo', handler = function(){ triggers++; }); cy.off({ 'foo': handler }); cy.trigger('foo'); expect( triggers ).to.equal(0); }); it('removes a handler with a selector', function(){ var triggers = 0; var handler; cy.on('foo', 'node', handler = function(){ triggers++; }); cy.off('foo', 'node', handler); cy.$('#n1').trigger('foo'); expect( triggers ).to.equal(0); }); it('removes a handler with a selector and handler unspecified', function(){ var triggers = 0; var handler; cy.on('foo', 'node', handler = function(){ triggers++; }); cy.off('foo', 'node'); cy.$('#n1').trigger('foo'); expect( triggers ).to.equal(0); }); it('removes multiple handlers of same event type', function(){ var triggers = 0; var handler1, handler2; cy.on('foo', handler1 = function(){ triggers++; }); cy.on('foo', handler2 = function(){ triggers++; }); cy.off('foo'); cy.trigger('foo'); expect( triggers ).to.equal(0); }); it('removes multiple handlers of same event type and selector', function(){ var triggers = 0; var handler1, handler2; cy.on('foo', 'node', handler1 = function(){ triggers++; }); cy.on('foo', 'node', handler2 = function(){ triggers++; }); cy.off('foo', 'node'); cy.$('#n1').trigger('foo'); expect( triggers ).to.equal(0); }); }); describe('cy.trigger()', function(){ it('triggers the handler', function(){ var triggers = 0; cy.on('foo', function(){ triggers++; }); cy.trigger('foo'); expect( triggers ).to.equal(1); }); it('passes extra params correctly', function(done){ cy.on('foo', function(e, bar, baz){ expect( bar ).to.equal('bar'); expect( baz ).to.equal('baz'); done(); }); cy.trigger('foo', ['bar', 'baz']); }); }); describe('eles.on()', function(){ var triggers = 0; var n1; var handler = function(){ triggers++; } beforeEach(function(){ triggers = 0; n1 = cy.$('#n1'); }); it('should get triggered with matching event', function(){ n1.on('foo', handler); n1.trigger('foo'); expect( triggers ).to.equal(1); }); it('should get triggered with matching event and namespace', function(){ n1.on('foo.bar', handler); n1.trigger('foo.bar'); expect( triggers ).to.equal(1); }); it('should get triggered with matching event and delegate selector', function(){ cy.$('#n4').on('foo', 'node', handler); cy.$('#n5').trigger('foo'); expect( triggers ).to.equal(1); }); it('should pass extra data correctly', function(done){ n1.on('foo', { bar: 'baz' }, function(e){ expect( e.data.bar ).to.equal('baz'); done(); }); n1.trigger('foo'); }); }); describe('eles.one()', function(){ var triggers = 0; var n1; var handler = function(){ triggers++; } beforeEach(function(){ triggers = 0; n1 = cy.$('#n1'); }); it('triggers only one time', function(){ n1.one('foo', handler); n1.trigger('foo'); expect( triggers ).to.equal(1); n1.trigger('foo'); expect( triggers ).to.equal(1); }); it('triggers once per element', function(){ cy.nodes().one('foo', handler); cy.nodes().trigger('foo'); expect( triggers ).to.equal(5); cy.nodes().trigger('foo'); expect( triggers ).to.equal(5); }); it('triggers only one time with delegate', function(){ cy.$('#n4').one('foo', 'node', handler); cy.$('#n5').trigger('foo'); expect( triggers ).to.equal(1); cy.$('#n5').trigger('foo'); expect( triggers ).to.equal(1); }); it('passes data correctly', function(){ var evt; n1.one('foo', { bar: 'baz' }, function(e){ evt = e; }); n1.trigger('foo'); expect( evt.data ).to.exist; expect( evt.data.bar ).to.exist; expect( evt.data.bar ).to.equal('baz'); }); }); describe('eles.once()', function(){ var triggers = 0; var n1; var handler = function(){ triggers++; } beforeEach(function(){ triggers = 0; n1 = cy.$('#n1'); }); it('triggers only one time', function(){ n1.once('foo', handler); n1.trigger('foo'); expect( triggers ).to.equal(1); n1.trigger('foo'); expect( triggers ).to.equal(1); }); it('triggers only one time for all elements', function(){ cy.nodes().once('foo', handler); cy.nodes().trigger('foo'); expect( triggers ).to.equal(1); cy.nodes().trigger('foo'); expect( triggers ).to.equal(1); }); it('triggers only one time with delegate', function(){ cy.$('#n4').once('foo', 'node', handler); cy.$('#n5').trigger('foo'); expect( triggers ).to.equal(1); cy.$('#n5').trigger('foo'); expect( triggers ).to.equal(1); }); it('passes data correctly', function(){ var evt; n1.once('foo', { bar: 'baz' }, function(e){ evt = e; }); n1.trigger('foo'); expect( evt.data ).to.exist; expect( evt.data.bar ).to.exist; expect( evt.data.bar ).to.equal('baz'); }); }); describe('eles.off()', function(){ var triggers = 0; var n1; var handler = function(){ triggers++; } beforeEach(function(){ triggers = 0; n1 = cy.$('#n1'); }); it('should remove all handlers for same event type', function(){ cy.nodes().on('foo', handler); cy.nodes() .off('foo') .trigger('foo') ; expect( triggers ).to.equal(0); }); it('should remove all handlers for matching event and delegate selector', function(){ cy.nodes().on('foo', 'node', handler); cy.nodes() .off('foo', 'node') .trigger('foo') ; expect( triggers ).to.equal(0); }); it('should remove all matching handlers', function(){ cy.nodes().on('foo', handler); cy.nodes() .off('foo', handler) .trigger('foo') ; expect( triggers ).to.equal(0); }); }); describe('eles.trigger()', function(){ var triggers = 0; var n1; var handler = function(){ triggers++; } beforeEach(function(){ triggers = 0; n1 = cy.$('#n1'); }); it('should trigger for one element', function(){ n1.on('foo', handler); n1.trigger('foo'); expect( triggers ).to.equal(1); }); it('should trigger for multiple elements', function(){ cy.nodes().on('foo', handler); cy.nodes().trigger('foo'); expect( triggers ).to.equal(6); // NB 2x for parent }); it('should trigger with extra parameters', function(done){ n1.on('foo', function(e, bar, baz){ expect( bar ).to.equal('bar'); expect( baz ).to.equal('baz'); done(); }); n1.trigger('foo', ['bar', 'baz']); }); }); describe('eles.promiseOn()', function(){ var n1; beforeEach(function(){ n1 = cy.$('#n1'); }); it('should run a then() callback', function( next ){ n1.pon('foo').then(function(){ next(); }); n1.trigger('foo'); }); it('should receive event obj', function( next ){ n1.pon('foo').then(function( e ){ expect( e ).to.not.be.undefined; expect( e.type ).to.equal('foo'); next(); }); n1.trigger('foo'); }); it('should run callback only once', function( next ){ var trigs = 0; n1.pon('foo').then(function(){ trigs++; }); n1.trigger('foo'); n1.trigger('foo'); setTimeout(function(){ expect( trigs ).to.equal(1); next(); }, 50); }); }); });
rlugojr/cytoscape.js
test/events.js
JavaScript
mit
17,147
### Introspection Type introspection is a core feature of Gravity. In Gravity, the Object class (ancestor of every class) provides methods for checking the instance's class. All Objects now responds to the following methods: ```swift Object.introspection(); Object.methods(); Object.properties(); ``` Each method support two optional parameters: * param1 a Bool value (default false), if set to true returns extended information * param2 a Bool value (default false), if set to true it scan super classes hierarchy Result can be a List or a Map (in case of param1 set to true). Examples: ```swift List.introspection(); // returns: [sort,reduce,loop,sorted,contains,filter,count,reverse,iterate,push,remove,pop,storeat,loadat,reversed,indexOf,next,map,join] List.introspection(true); // returns: [sorted:[isvar:false,name:sorted],next:[isvar:false,name:next],sort:[isvar:false,name:sort],filter:[isvar:false,name:filter],storeat:[isvar:false,name:storeat],map:[isvar:false,name:map],indexOf:[isvar:false,name:indexOf],reversed:[isvar:false,name:reversed],contains:[isvar:false,name:contains],loop:[isvar:false,name:loop],reduce:[isvar:false,name:reduce],count:[isvar:true,name:count,readonly:true],loadat:[isvar:false,name:loadat],iterate:[isvar:false,name:iterate],remove:[isvar:false,name:remove]... ```
marcobambini/gravity
docs/introspection.md
Markdown
mit
1,323
The MIT License (MIT) Copyright (c) 2016 Kevin E. Murray Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
kmurray/libvcdparse
LICENSE.md
Markdown
mit
1,082
package com.lothrazar.samsprojectiles; import com.lothrazar.samsprojectiles.entity.projectile.*; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.translation.I18n; import net.minecraft.world.World; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.EntityRegistry; @Mod(modid = ModProj.MODID, useMetadata = true, updateJSON = "https://raw.githubusercontent.com/LothrazarMinecraftMods/EnderProjectiles/master/update.json") public class ModProj{ public static final String MODID = "samsprojectiles"; public static final String TEXTURE_LOCATION = MODID + ":"; @SidedProxy(clientSide = "com.lothrazar.samsprojectiles.ClientProxy", serverSide = "com.lothrazar.samsprojectiles.CommonProxy") public static CommonProxy proxy; @Instance(value = ModProj.MODID) public static ModProj instance; public static CreativeTabs tabSamsContent = new CreativeTabs("tabSamsProj") { @Override public Item getTabIconItem(){ return ItemRegistry.ender_harvest; } }; public static int fishing_recipe; public static int wool_recipe; public static int torch_recipe; public static int lightning_recipe; public static int snow_recipe; public static int water_recipe; public static int harvest_recipe; public static int bed_recipe; public static int dungeon_recipe; public static int tnt_recipe; public static int blaze_recipe; public static int DUNGEONRADIUS = 64;// TODO: config file for these? yes no? Configuration config; @EventHandler public void onPreInit(FMLPreInitializationEvent event){ config = new Configuration(event.getSuggestedConfigurationFile()); loadConfig(); ItemRegistry.registerItems(); // MinecraftForge.EVENT_BUS.register(new ModEvents()); } private void loadConfig(){ config.load(); config.addCustomCategoryComment(MODID, "For each item, you can decide how many the recipe produces. Set to zero to disable the crafting recipe."); torch_recipe = config.getInt("torch.crafted", MODID, 6, 0, 64, ""); lightning_recipe = config.getInt("lightning.crafted", MODID, 1, 0, 64, ""); snow_recipe = config.getInt("snow.crafted", MODID, 4, 0, 64, ""); water_recipe = config.getInt("water.crafted", MODID, 4, 0, 64, ""); harvest_recipe = config.getInt("harvest.crafted", MODID, 4, 0, 64, ""); wool_recipe = config.getInt("wool.crafted", MODID, 32, 0, 64, ""); fishing_recipe = config.getInt("fishing.recipe", MODID, 10, 0, 64, ""); bed_recipe = config.getInt("bed.recipe", MODID, 4, 0, 64, ""); dungeon_recipe = config.getInt("dungeon.recipe", MODID, 4, 0, 64, ""); tnt_recipe = config.getInt("tnt.recipe", MODID, 6, 0, 64, ""); blaze_recipe = config.getInt("blaze.recipe", MODID, 3, 0, 64, ""); ModProj.DUNGEONRADIUS = config.getInt("dungeon.radius", MODID, 64, 8, 128, "Search distance"); EntityShearingBolt.doesKnockback = config.getBoolean("wool.does_knockback", MODID, true, "Does appear to damage sheep on contact"); EntityShearingBolt.doesShearChild = config.getBoolean("wool.does_child", MODID, true, "Does shear child sheep as well."); EntityBlazeBolt.fireSeconds = config.getInt("blaze.fire_seconds", MODID, 3, 0, 64, "Seconds of fire to put on entity when hit"); EntityBlazeBolt.damageEntityOnHit = config.getBoolean("blaze.does_knockback", MODID, true, "Does it damage entity or not on hit (0 damage to blaze, 1 to others)"); EntitySnowballBolt.damageEntityOnHit = config.getBoolean("snow.does_knockback", MODID, true, "Does it damage entity or not on hit (1 damage to blaze, 0 to others)"); EntityTorchBolt.damageEntityOnHit = config.getBoolean("torch.does_knockback", MODID, true, "Does it damage entity or not on hit (0 dmg like a snowball)"); EntityHarvestBolt.range_main = config.getInt("harvest.range_main", MODID, 6, 1, 32, "Horizontal range on level of hit to harvest"); EntityHarvestBolt.range_offset = config.getInt("harvest.range_offset", MODID, 4, 1, 32, "Horizontal range on further heights to harvest"); EntityHarvestBolt.doesHarvestStem = config.getBoolean("harvest.does_harvest_stem", MODID, false, "Does it harvest stems (pumkin/melon)"); EntityHarvestBolt.doesHarvestSapling = config.getBoolean("harvest.does_harvest_sapling", MODID, false, "Does it harvest sapling"); EntityHarvestBolt.doesHarvestTallgrass = config.getBoolean("harvest.does_harvest_tallgrass", MODID, false, "Does it harvest tallgrass/doubleplants"); EntityHarvestBolt.doesHarvestMushroom = config.getBoolean("harvest.does_harvest_mushroom", MODID, true, "Does it harvest mushrooms"); EntityHarvestBolt.doesMelonBlocks = config.getBoolean("harvest.does_harvest_melonblock", MODID, true, "Does it harvest pumpkin block"); EntityHarvestBolt.doesPumpkinBlocks = config.getBoolean("harvest.does_harvest_pumpkinblock", MODID, true, "Does it harvest melon block"); if(config.hasChanged()){ config.save(); } } @EventHandler public void onInit(FMLInitializationEvent event){ int entityID = 999; EntityRegistry.registerModEntity(EntityLightningballBolt.class, "lightningbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntityHarvestBolt.class, "harvestbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntityWaterBolt.class, "waterbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntitySnowballBolt.class, "frostbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntityTorchBolt.class, "torchbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntityShearingBolt.class, "woolbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntityFishingBolt.class, "fishingbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntityHomeBolt.class, "bedbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntityDungeonEye.class, "dungeonbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntityDynamite.class, "tntbolt", entityID++, instance, 64, 1, true); EntityRegistry.registerModEntity(EntityBlazeBolt.class, "tntbolt", entityID++, instance, 64, 1, true); proxy.registerRenderers(); } public static BlockPos findClosestBlock(EntityPlayer player, Block blockHunt, int RADIUS){ // imported from MY CommandSearchSpawner in ./Commands/ BlockPos found = null; int xMin = (int) player.posX - RADIUS; int xMax = (int) player.posX + RADIUS; int yMin = (int) player.posY - RADIUS; int yMax = (int) player.posY + RADIUS; int zMin = (int) player.posZ - RADIUS; int zMax = (int) player.posZ + RADIUS; int distance = 0, distanceClosest = RADIUS * RADIUS; BlockPos posCurrent = null; for(int xLoop = xMin; xLoop <= xMax; xLoop++){ for(int yLoop = yMin; yLoop <= yMax; yLoop++){ for(int zLoop = zMin; zLoop <= zMax; zLoop++){ posCurrent = new BlockPos(xLoop, yLoop, zLoop); if(player.worldObj.getBlockState(posCurrent).getBlock().equals(blockHunt)){ // find closest? if(found == null){ found = posCurrent; } else{ distance = (int) distanceBetweenHorizontal(player.getPosition(), posCurrent); if(distance < distanceClosest){ found = posCurrent; distanceClosest = distance; } } } } } } return found; } public static double distanceBetweenHorizontal(BlockPos start, BlockPos end){ int xDistance = Math.abs(start.getX() - end.getX()); int zDistance = Math.abs(start.getZ() - end.getZ()); // ye olde pythagoras return Math.sqrt(xDistance * xDistance + zDistance * zDistance); } public static void addChatMessage(EntityPlayer player, String string){ player.addChatMessage(new TextComponentTranslation(string)); } public static void spawnParticle(World world, EnumParticleTypes type, BlockPos pos){ spawnParticle(world, type, pos.getX(), pos.getY(), pos.getZ()); } public static void spawnParticle(World world, EnumParticleTypes type, double x, double y, double z){ // http://www.minecraftforge.net/forum/index.php?topic=9744.0 for(int countparticles = 0; countparticles <= 10; ++countparticles){ world.spawnParticle(type, x + (world.rand.nextDouble() - 0.5D) * (double) 0.8, y + world.rand.nextDouble() * (double) 1.5 - (double) 0.1, z + (world.rand.nextDouble() - 0.5D) * (double) 0.8, 0.0D, 0.0D, 0.0D); } } public static String lang(String name){ return I18n.translateToLocal(name); } }
PrinceOfAmber/EnderProjectiles
src/main/java/com/lothrazar/samsprojectiles/ModProj.java
Java
mit
9,072
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>CivilOctave: [email protected]/usepackage_8tex.tex Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">CivilOctave </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="namespaces.html"><span>Packages</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> <li><a href="globals.html"><span>File&#160;Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_5df9b5f8191c445162897bbb77f834f4.html">[email protected]</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">usepackage_8tex.tex</div> </div> </div><!--header--> <div class="contents"> <a href="amarjeet_0Dlab_8gdy_8club_2usepackage__8tex_8tex.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;\hypertarget{usepackage_8tex}{}\section{/home/amarjeet/projects/\+Civil\+Octave/\+Examples/\+Do\+S/01/tex/usepackage.tex File Reference}</div> <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;\label{usepackage_8tex}\index{/home/amarjeet/projects/\+Civil\+Octave/\+Examples/\+Do\+S/01/tex/usepackage.\+tex@{/home/amarjeet/projects/\+Civil\+Octave/\+Examples/\+Do\+S/01/tex/usepackage.\+tex}}</div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Dec 18 2015 16:53:12 for CivilOctave by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.11 </small></address> </body> </html>
GreatDevelopers/CivilOctave
Documentation/html/amarjeet_0Dlab_8gdy_8club_2usepackage__8tex_8tex_source.html
HTML
mit
2,933
// Description: Evaluate C# code and expression in T-SQL stored procedure, function and trigger. // Website & Documentation: https://github.com/zzzprojects/Eval-SQL.NET // Forum & Issues: https://github.com/zzzprojects/Eval-SQL.NET/issues // License: https://github.com/zzzprojects/Eval-SQL.NET/blob/master/LICENSE // More projects: http://www.zzzprojects.com/ // Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. using System; // ReSharper disable InconsistentNaming namespace Z.Expressions.SqlServer.Eval { public partial struct SQLNET { /// <summary>Gets the tiny int value associated with the specified key.</summary> /// <param name="key">The key of the value to get.</param> /// <returns>The tiny int value associated with the specified key.</returns> public byte? GetValueTinyInt(string key) { var value = GetValue(key); return value == DBNull.Value ? (byte?) null : Convert.ToByte(value); } /// <summary>Gets the tiny int value associated with the specified key.</summary> /// <param name="key">The key of the value to get.</param> /// <returns>The tiny int value associated with the specified key.</returns> public byte? getvaluetinyint(string key) { return GetValueTinyInt(key); } /// <summary>Gets the tiny int value associated with the specified key.</summary> /// <param name="key">The key of the value to get.</param> /// <returns>The tiny int value associated with the specified key.</returns> public byte? GETVALUETINYINT(string key) { return GetValueTinyInt(key); } } }
zzzprojects/Z.Expressions.Eval.SqlServer
src/Z.Expressions.SqlServer.Eval/SQLNET/Getter/GetValueTinyInt.cs
C#
mit
1,709
using System; using GraphQL.DI; using GraphQL.Execution; using Moq; using Shouldly; using Xunit; namespace GraphQL.DataLoader.Tests { public class GraphQLBuilderTests { [Fact] public void AddDataLoader() { var instance = new DataLoaderDocumentListener(new DataLoaderContextAccessor()); var mockBuilder = new Mock<IGraphQLBuilder>(MockBehavior.Strict); var builder = mockBuilder.Object; mockBuilder.Setup(x => x.Register(typeof(IDataLoaderContextAccessor), typeof(DataLoaderContextAccessor), ServiceLifetime.Singleton, false)).Returns(builder).Verifiable(); mockBuilder.Setup(x => x.Register(typeof(IDocumentExecutionListener), typeof(DataLoaderDocumentListener), ServiceLifetime.Singleton, false)).Returns(builder).Verifiable(); mockBuilder.Setup(x => x.Register(typeof(DataLoaderDocumentListener), typeof(DataLoaderDocumentListener), ServiceLifetime.Singleton, false)).Returns(builder).Verifiable(); var mockServiceProvider = new Mock<IServiceProvider>(MockBehavior.Strict); mockServiceProvider.Setup(x => x.GetService(typeof(DataLoaderDocumentListener))).Returns(instance).Verifiable(); mockBuilder.Setup(x => x.Register(typeof(IConfigureExecution), It.IsAny<object>(), false)) .Returns<Type, IConfigureExecution, bool>((_, action, _) => { var options = new ExecutionOptions() { RequestServices = mockServiceProvider.Object }; action.ConfigureAsync(options).Wait(); options.Listeners.ShouldContain(instance); return builder; }).Verifiable(); builder.AddDataLoader(); mockServiceProvider.Verify(); mockBuilder.Verify(); } } }
graphql-dotnet/graphql-dotnet
src/GraphQL.DataLoader.Tests/GraphQLBuilderTests.cs
C#
mit
1,908
{% import "lib/githubLinks.html" as github -%} {% set relativePath = doc.fileInfo.relativePath %} {% if doc.title %}{$ ('# ' + doc.title.trim()) | marked $}{% endif %} {% if 'guide/' in relativePath or 'tutorial/' in relativePath or 'docs.md' in relativePath %} <div class="github-links"> {$ github.githubEditLink(doc, versionInfo) $} </div> {% endif %} <div class="content"> {$ doc.description | marked $} </div>
trshafer/angular
aio/tools/transforms/templates/content.template.html
HTML
mit
423
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections; namespace System.Diagnostics { public class EventLogEntryCollection : ICollection { private readonly EventLogInternal _log; internal EventLogEntryCollection(EventLogInternal log) { _log = log; } public int Count { get { return _log.EntryCount; } } public virtual EventLogEntry this[int index] { get { return _log.GetEntryAt(index); } } public void CopyTo(EventLogEntry[] entries, int index) { ((ICollection)this).CopyTo((Array)entries, index); } public IEnumerator GetEnumerator() { return new EntriesEnumerator(this); } internal EventLogEntry GetEntryAtNoThrow(int index) { return _log.GetEntryAtNoThrow(index); } bool ICollection.IsSynchronized { get { return false; } } object ICollection.SyncRoot { get { return this; } } void ICollection.CopyTo(Array array, int index) { EventLogEntry[] entries = _log.GetAllEntries(); Array.Copy(entries, 0, array, index, entries.Length); } private class EntriesEnumerator : IEnumerator { private EventLogEntryCollection entries; private int num = -1; private EventLogEntry cachedEntry = null; internal EntriesEnumerator(EventLogEntryCollection entries) { this.entries = entries; } public object Current { get { if (cachedEntry == null) throw new InvalidOperationException(SR.NoCurrentEntry); return cachedEntry; } } public bool MoveNext() { num++; cachedEntry = entries.GetEntryAtNoThrow(num); return cachedEntry != null; } public void Reset() { num = -1; } } } }
parjong/corefx
src/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogEntryCollection.cs
C#
mit
2,561
#include "App.h" #include <Bengine/ScreenList.h> App::App() { } App::~App() { } void App::onInit() { } void App::addScreens() { m_mainMenuScreen = std::make_unique<MainMenuScreen>(&m_window); m_gameplayScreen = std::make_unique<GameplayScreen>(&m_window); m_editorScreen = std::make_unique<EditorScreen>(&m_window); m_screenList->addScreen(m_mainMenuScreen.get()); m_screenList->addScreen(m_gameplayScreen.get()); m_screenList->addScreen(m_editorScreen.get()); m_screenList->setScreen(m_mainMenuScreen->getScreenIndex()); } void App::onExit() { }
Barnold1953/GraphicsTutorials
NinjaPlatformer/App.cpp
C++
mit
587
<?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_PT" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Litecoin</source> <translation>Sobre Peacecoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Litecoin&lt;/b&gt; version</source> <translation>Versão do &lt;b&gt;Peacecoin&lt;/b&gt;</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source> <translation> Este é um programa experimental. Distribuído sob uma licença de software MIT/X11, por favor verifique o ficheiro anexo license.txt ou http://www.opensource.org/licenses/mit-license.php. Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no OpenSSL Toolkit (http://www.openssl.org/), software criptográfico escrito por Eric Young ([email protected]) e software UPnP escrito por Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Copyright</translation> </message> <message> <location line="+0"/> <source>The Litecoin developers</source> <translation>Os programadores Peacecoin</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Livro de endereços</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Clique duas vezes para editar o endereço ou o rótulo</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Criar um novo endereço</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copie o endereço selecionado para a área de transferência</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Novo Endereço</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Litecoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Estes são os seus endereços Peacecoin para receber pagamentos. Poderá enviar um endereço diferente para cada remetente para poder identificar os pagamentos.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Copiar Endereço</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Mostrar Código &amp;QR</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Litecoin address</source> <translation>Assine uma mensagem para provar que é dono de um endereço Peacecoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Assinar &amp;Mensagem</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Apagar o endereço selecionado da lista</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados no separador actual para um ficheiro</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Litecoin address</source> <translation>Verifique a mensagem para assegurar que foi assinada com o endereço Peacecoin especificado</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>E&amp;liminar</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Litecoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Estes são os seus endereços Peacecoin para enviar pagamentos. Verifique sempre o valor e a morada de envio antes de enviar moedas.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Copiar &amp;Rótulo</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Enviar &amp;Moedas</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Exportar dados do Livro de Endereços</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Ficheiro separado por vírgulas (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Erro ao exportar</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Não foi possível escrever para o ficheiro %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Rótulo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Diálogo de Frase-Passe</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Escreva a frase de segurança</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova frase de segurança</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Repita a nova frase de segurança</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Escreva a nova frase de seguraça da sua carteira. &lt;br/&gt; Por favor, use uma frase de &lt;b&gt;10 ou mais caracteres aleatórios,&lt;/b&gt; ou &lt;b&gt;oito ou mais palavras&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Encriptar carteira</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>A sua frase de segurança é necessária para desbloquear a carteira.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Desbloquear carteira</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>A sua frase de segurança é necessária para desencriptar a carteira.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Desencriptar carteira</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Alterar frase de segurança</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Escreva a frase de segurança antiga seguida da nova para a carteira.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirmar encriptação da carteira</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR LITECOINS&lt;/b&gt;!</source> <translation>Atenção: Se encriptar a carteira e perder a sua senha irá &lt;b&gt;PERDER TODOS OS SEUS PeacecoinS&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Tem a certeza que deseja encriptar a carteira?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>IMPORTANTE: Qualquer cópia de segurança anterior da carteira deverá ser substituída com o novo, actualmente encriptado, ficheiro de carteira. Por razões de segurança, cópias de segurança não encriptadas efectuadas anteriormente do ficheiro da carteira tornar-se-ão inúteis assim que começar a usar a nova carteira encriptada.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Atenção: A tecla Caps Lock está activa!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Carteira encriptada</translation> </message> <message> <location line="-56"/> <source>Litecoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your litecoins from being stolen by malware infecting your computer.</source> <translation>O cliente Peacecoin irá agora ser fechado para terminar o processo de encriptação. Recorde que a encriptação da sua carteira não protegerá totalmente os seus Peacecoins de serem roubados por programas maliciosos que infectem o seu computador.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>A encriptação da carteira falhou</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>A encriptação da carteira falhou devido a um erro interno. A carteira não foi encriptada.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>As frases de segurança fornecidas não coincidem.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>O desbloqueio da carteira falhou</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>A frase de segurança introduzida para a desencriptação da carteira estava incorreta.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>A desencriptação da carteira falhou</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>A frase de segurança da carteira foi alterada com êxito.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Assinar &amp;mensagem...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Sincronizando com a rede...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>Visã&amp;o geral</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Mostrar visão geral da carteira</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transações</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Navegar pelo histórico de transações</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Editar a lista de endereços e rótulos</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Mostrar a lista de endereços para receber pagamentos</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>Fec&amp;har</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Sair da aplicação</translation> </message> <message> <location line="+4"/> <source>Show information about Litecoin</source> <translation>Mostrar informação sobre Peacecoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Sobre &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Mostrar informação sobre Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Opções...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>E&amp;ncriptar Carteira...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Guardar Carteira...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>Mudar &amp;Palavra-passe...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Importando blocos do disco...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Reindexando blocos no disco...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Litecoin address</source> <translation>Enviar moedas para um endereço Peacecoin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Litecoin</source> <translation>Modificar opções de configuração para Peacecoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Faça uma cópia de segurança da carteira para outra localização</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Mudar a frase de segurança utilizada na encriptação da carteira</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>Janela de &amp;depuração</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Abrir consola de diagnóstico e depuração</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensagem...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Litecoin</source> <translation>Peacecoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Enviar</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Receber</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>E&amp;ndereços</translation> </message> <message> <location line="+22"/> <source>&amp;About Litecoin</source> <translation>&amp;Sobre o Peacecoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>Mo&amp;strar / Ocultar</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Mostrar ou esconder a Janela principal</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Encriptar as chaves privadas que pertencem à sua carteira</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Litecoin addresses to prove you own them</source> <translation>Assine mensagens com os seus endereços Peacecoin para provar que os controla</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Litecoin addresses</source> <translation>Verifique mensagens para assegurar que foram assinadas com o endereço Peacecoin especificado</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Ficheiro</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>Con&amp;figurações</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>A&amp;juda</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Barra de separadores</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[rede de testes]</translation> </message> <message> <location line="+47"/> <source>Litecoin client</source> <translation>Cliente Peacecoin</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Litecoin network</source> <translation><numerusform>%n ligação ativa à rede Peacecoin</numerusform><numerusform>%n ligações ativas à rede Peacecoin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Nenhum bloco fonto disponível</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Processados %1 dos %2 blocos (estimados) do histórico de transacções.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Processados %1 blocos do histórico de transações.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n semana</numerusform><numerusform>%n semanas</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 em atraso</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Último bloco recebido foi gerado há %1 atrás.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Transações posteriores poderão não ser imediatamente visíveis.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Informação</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Esta transação tem um tamanho superior ao limite máximo. Poderá enviá-la pagando uma taxa de %1, que será entregue ao nó que processar a sua transação e ajudará a suportar a rede. Deseja pagar a taxa?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Atualizado</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Recuperando...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Confirme a taxa de transação</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Transação enviada</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Transação recebida</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Data: %1 Quantia: %2 Tipo: %3 Endereço: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Manuseamento URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Litecoin address or malformed URI parameters.</source> <translation>URI não foi lido correctamente! Isto pode ser causado por um endereço Peacecoin inválido ou por parâmetros URI malformados.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>A carteira está &lt;b&gt;encriptada&lt;/b&gt; e atualmente &lt;b&gt;desbloqueada&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>A carteira está &lt;b&gt;encriptada&lt;/b&gt; e atualmente &lt;b&gt;bloqueada&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Litecoin can no longer continue safely and will quit.</source> <translation>Ocorreu um erro fatal. O Peacecoin não pode continuar com segurança e irá fechar.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Alerta da Rede</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Editar Endereço</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Rótulo</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>O rótulo a ser associado com esta entrada do livro de endereços</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>E&amp;ndereço</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>O endereço associado com esta entrada do livro de endereços. Apenas poderá ser modificado para endereços de saída.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Novo endereço de entrada</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Novo endereço de saída</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Editar endereço de entrada</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Editar endereço de saída</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>O endereço introduzido &quot;%1&quot; já se encontra no livro de endereços.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Litecoin address.</source> <translation>O endereço introduzido &quot;%1&quot; não é um endereço Peacecoin válido.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Impossível desbloquear carteira.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Falha ao gerar nova chave.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Litecoin-Qt</source> <translation>Peacecoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versão</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Utilização:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>opções da linha de comandos</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Opções de UI</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Definir linguagem, por exemplo &quot;pt_PT&quot; (por defeito: linguagem do sistema)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Iniciar minimizado</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Mostrar animação ao iniciar (por defeito: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opções</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Principal</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>Taxa de transação opcional por KB que ajuda a assegurar que as suas transações serão processadas rapidamente. A maioria das transações tem 1 kB.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Pagar &amp;taxa de transação</translation> </message> <message> <location line="+31"/> <source>Automatically start Litecoin after logging in to the system.</source> <translation>Começar o Peacecoin automaticamente ao iniciar sessão no sistema.</translation> </message> <message> <location line="+3"/> <source>&amp;Start Litecoin on system login</source> <translation>&amp;Começar o Peacecoin ao iniciar o sistema</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Repôr todas as opções.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Repôr Opções</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Rede</translation> </message> <message> <location line="+6"/> <source>Automatically open the Litecoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Abrir a porta do cliente Peacecoin automaticamente no seu router. Isto penas funciona se o seu router suportar UPnP e este se encontrar ligado.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapear porta usando &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Litecoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Ligar à rede Peacecoin através de um proxy SOCKS (p.ex. quando ligar através de Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>Ligar através de proxy SO&amp;CKS:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP do proxy:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Endereço IP do proxy (p.ex. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta do proxy (p.ex. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Versão SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versão do proxy SOCKS (p.ex. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Janela</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Apenas mostrar o ícone da bandeja após minimizar a janela.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizar para a bandeja e não para a barra de ferramentas</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimize ao invés de sair da aplicação quando a janela é fechada. Com esta opção selecionada, a aplicação apenas será encerrada quando escolher Sair da aplicação no menú.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar ao fechar</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>Vis&amp;ualização</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Linguagem da interface de utilizador:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Litecoin.</source> <translation>A linguagem da interface do utilizador pode ser definida aqui. Esta definição entrará em efeito após reiniciar o Peacecoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unidade a usar em quantias:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Escolha a subdivisão unitária a ser mostrada por defeito na aplicação e ao enviar moedas.</translation> </message> <message> <location line="+9"/> <source>Whether to show Litecoin addresses in the transaction list or not.</source> <translation>Se mostrar, ou não, os endereços Peacecoin na lista de transações.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>Mostrar en&amp;dereços na lista de transações</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Aplicar</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>padrão</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Confirme a reposição de opções</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>Algumas opções requerem o reinício do programa para funcionar.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Deseja proceder?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Litecoin.</source> <translation>Esta opção entrará em efeito após reiniciar o Peacecoin.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>O endereço de proxy introduzido é inválido. </translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Litecoin network after a connection is established, but this process has not completed yet.</source> <translation>A informação mostrada poderá estar desatualizada. A sua carteira sincroniza automaticamente com a rede Peacecoin depois de estabelecer ligação, mas este processo ainda não está completo.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Não confirmado:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Imaturo:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>O saldo minado ainda não maturou</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transações recentes&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>O seu saldo atual</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Total de transações ainda não confirmadas, e que não estão contabilizadas ainda no seu saldo actual</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>fora de sincronia</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start litecoin: click-to-pay handler</source> <translation>Impossível começar o modo clicar-para-pagar com Peacecoin:</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Diálogo de Código QR</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Requisitar Pagamento</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Rótulo:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Mensagem:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Salvar Como...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Erro ao codificar URI em Código QR.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>A quantia introduzida é inválida, por favor verifique.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI resultante muito longo. Tente reduzir o texto do rótulo / mensagem.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Guardar Código QR</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>Imagens PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nome do Cliente</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>N/D</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versão do Cliente</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informação</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Usando versão OpenSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Tempo de início</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Rede</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Número de ligações</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Em rede de testes</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Cadeia de blocos</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Número actual de blocos</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Total estimado de blocos</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Tempo do último bloco</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Opções de linha de comandos</translation> </message> <message> <location line="+7"/> <source>Show the Litecoin-Qt help message to get a list with possible Litecoin command-line options.</source> <translation>Mostrar a mensagem de ajuda do Peacecoin-Qt para obter uma lista com possíveis opções a usar na linha de comandos.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>Mo&amp;strar</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Consola</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Data de construção</translation> </message> <message> <location line="-104"/> <source>Litecoin - Debug window</source> <translation>Peacecoin - Janela de depuração</translation> </message> <message> <location line="+25"/> <source>Litecoin Core</source> <translation>Núcleo Peacecoin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Ficheiro de registo de depuração</translation> </message> <message> <location line="+7"/> <source>Open the Litecoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Abrir o ficheiro de registo de depuração da pasta de dados actual. Isto pode demorar alguns segundos para ficheiros de registo maiores.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Limpar consola</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Litecoin RPC console.</source> <translation>Bem-vindo à consola RPC Peacecoin.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Use as setas para cima e para baixo para navegar no histórico e &lt;b&gt;Ctrl-L&lt;/b&gt; para limpar o ecrã.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Digite &lt;b&gt;help&lt;/b&gt; para visualizar os comandos disponíveis.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Enviar Moedas</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Enviar para múltiplos destinatários de uma vez</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Adicionar &amp;Destinatário</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Remover todos os campos da transação</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>&amp;Limpar Tudo</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirme ação de envio</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Enviar</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; para %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirme envio de moedas</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Tem a certeza que deseja enviar %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> e </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>O endereço de destino não é válido, por favor verifique.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>A quantia a pagar deverá ser maior que 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>A quantia excede o seu saldo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>O total excede o seu saldo quando a taxa de transação de %1 for incluída.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Endereço duplicado encontrado, apenas poderá enviar uma vez para cada endereço por cada operação de envio.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Erro: A criação da transacção falhou! </translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Erro: A transação foi rejeitada. Isso poderá acontecer se algumas das moedas na sua carteira já tiverem sido gastas, se por exemplo tiver usado uma cópia do ficheiro wallet.dat e as moedas foram gastas na cópia mas não foram marcadas como gastas aqui.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Qu&amp;antia:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>&amp;Pagar A:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>O endereço para onde enviar o pagamento (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Escreva um rótulo para este endereço para o adicionar ao seu livro de endereços</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>Rótu&amp;lo:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Escolher endereço do livro de endereços</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Cole endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Remover este destinatário</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Litecoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Introduza um endereço Peacecoin (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Assinaturas - Assinar / Verificar uma Mensagem</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>A&amp;ssinar Mensagem</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Pode assinar mensagens com os seus endereços para provar que são seus. Tenha atenção ao assinar mensagens ambíguas, pois ataques de phishing podem tentar enganá-lo, de modo a assinar a sua identidade para os atacantes. Apenas assine declarações completamente detalhadas com as quais concorde.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>O endereço a utilizar para assinar a mensagem (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Escolher endereço do livro de endereços</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>Cole endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Escreva aqui a mensagem que deseja assinar</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Assinatura</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Copiar a assinatura actual para a área de transferência</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Litecoin address</source> <translation>Assine uma mensagem para provar que é dono deste endereço Peacecoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Assinar &amp;Mensagem</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Repôr todos os campos de assinatura de mensagem</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Limpar &amp;Tudo</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Introduza o endereço de assinatura, mensagem (assegure-se de copiar quebras de linha, espaços, tabuladores, etc. exactamente) e assinatura abaixo para verificar a mensagem. Tenha atenção para não ler mais na assinatura do que o que estiver na mensagem assinada, para evitar ser enganado por um atacante que se encontre entre si e quem assinou a mensagem.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>O endereço utilizado para assinar a mensagem (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Litecoin address</source> <translation>Verifique a mensagem para assegurar que foi assinada com o endereço Peacecoin especificado</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Verificar &amp;Mensagem</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Repôr todos os campos de verificação de mensagem</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Litecoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Introduza um endereço Peacecoin (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clique &quot;Assinar mensagem&quot; para gerar a assinatura</translation> </message> <message> <location line="+3"/> <source>Enter Litecoin signature</source> <translation>Introduza assinatura Peacecoin</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>O endereço introduzido é inválido. </translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Por favor verifique o endereço e tente de novo.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>O endereço introduzido não refere a chave alguma.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>O desbloqueio da carteira foi cancelado.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>A chave privada para o endereço introduzido não está disponível.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Assinatura de mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Mensagem assinada.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>A assinatura não pôde ser descodificada.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Por favor verifique a assinatura e tente de novo.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>A assinatura não condiz com o conteúdo da mensagem.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Verificação da mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Mensagem verificada.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Litecoin developers</source> <translation>Os programadores Peacecoin</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[rede de testes]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/desligado</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/não confirmada</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmações</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Estado</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, transmitida através de %n nó</numerusform><numerusform>, transmitida através de %n nós</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Origem</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Gerado</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Para</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>endereço próprio</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>rótulo</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>matura daqui por %n bloco</numerusform><numerusform>matura daqui por %n blocos</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>não aceite</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débito</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Taxa de transação</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Valor líquido</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Mensagem</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Comentário</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID da Transação</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Moedas geradas deverão maturar por 120 blocos antes de poderem ser gastas. Quando gerou este bloco, ele foi transmitido para a rede para ser incluído na cadeia de blocos. Se a inclusão na cadeia de blocos falhar, irá mudar o estado para &quot;não aceite&quot; e as moedas não poderão ser gastas. Isto poderá acontecer ocasionalmente se outro nó da rede gerar um bloco a poucos segundos de diferença do seu.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informação de depuração</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transação</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Entradas</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Quantia</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verdadeiro</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falso</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, ainda não foi transmitida com sucesso</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Aberta por mais %n bloco</numerusform><numerusform>Aberta por mais %n blocos</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>desconhecido</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalhes da transação</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Esta janela mostra uma descrição detalhada da transação</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Quantia</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Aberta por mais %n bloco</numerusform><numerusform>Aberta por mais %n blocos</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Desligado (%1 confirmação)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Não confirmada (%1 de %2 confirmações)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmada (%1 confirmação)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>Saldo minado ficará disponível quando maturar, daqui por %n bloco</numerusform><numerusform>Saldo minado ficará disponível quando maturar, daqui por %n blocos</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Este bloco não foi recebido por outros nós e provavelmente não será aceite pela rede!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Gerado mas não aceite</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Recebido com</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Recebido de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pagamento ao próprio</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Minado</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/d)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Estado da transação. Pairar por cima deste campo para mostrar o número de confirmações.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Data e hora a que esta transação foi recebida.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Tipo de transação.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Endereço de destino da transação.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Quantia retirada ou adicionada ao saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Todas</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hoje</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Esta semana</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Este mês</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mês passado</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Este ano</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Período...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Recebida com</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Enviada para</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Para si</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Minadas</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Outras</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Escreva endereço ou rótulo a procurar</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Quantia mínima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar rótulo</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copiar ID da Transação</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Editar rótulo</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Mostrar detalhes da transação</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Exportar Dados das Transações</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Ficheiro separado por vírgula (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmada</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Rótulo</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Quantia</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Erro ao exportar</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossível escrever para o ficheiro %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Período:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>até</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Enviar Moedas</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados no separador actual para um ficheiro</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Cópia de Segurança da Carteira</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Dados da Carteira (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Cópia de Segurança Falhou</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Ocorreu um erro ao tentar guardar os dados da carteira na nova localização.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Cópia de Segurança Bem Sucedida</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Os dados da carteira foram salvos com sucesso numa nova localização.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Litecoin version</source> <translation>Versão Peacecoin</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Utilização:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or litecoind</source> <translation>Enviar comando para -server ou Peacecoind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Listar comandos</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Obter ajuda para um comando</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Opções:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: litecoin.conf)</source> <translation>Especificar ficheiro de configuração (por defeito: Peacecoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: litecoind.pid)</source> <translation>Especificar ficheiro pid (por defeito: Peacecoind.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Especificar pasta de dados</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Definir o tamanho da cache de base de dados em megabytes (por defeito: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation>Escute por ligações em &lt;port&gt; (por defeito: 9333 ou testnet: 19333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Manter no máximo &lt;n&gt; ligações a outros nós da rede (por defeito: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Ligar a um nó para recuperar endereços de pares, e desligar</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Especifique o seu endereço público</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Tolerância para desligar nós mal-formados (por defeito: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Número de segundos a impedir que nós mal-formados se liguem de novo (por defeito: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Ocorreu um erro ao definir a porta %u do serviço RPC a escutar em IPv4: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation>Escutar por ligações JSON-RPC em &lt;port&gt; (por defeito: 9332 ou rede de testes: 19332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Aceitar comandos da consola e JSON-RPC</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Correr o processo como um daemon e aceitar comandos</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Utilizar a rede de testes - testnet</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Aceitar ligações externas (padrão: 1 sem -proxy ou -connect)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=litecoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Litecoin Alert&quot; [email protected] </source> <translation>%s, deverá definir rpcpassword no ficheiro de configuração : %s É recomendado que use a seguinte palavra-passe aleatória: rpcuser=litecoinrpc rpcpassword=%s (não precisa recordar esta palavra-passe) O nome de utilizador e password NÃO DEVEM ser iguais. Se o ficheiro não existir, crie-o com permissões de leitura apenas para o dono. Também é recomendado definir alertnotify para que seja alertado sobre problemas; por exemplo: alertnotify=echo %%s | mail -s &quot;Alerta Litecoin&quot; [email protected] </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Ocorreu um erro ao definir a porta %u do serviço RPC a escutar em IPv6, a usar IPv4: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Trancar a endereço específio e sempre escutar nele. Use a notação [anfitrião]:porta para IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Litecoin is probably already running.</source> <translation>Impossível trancar a pasta de dados %s. Provavelmente o Peacecoin já está a ser executado.</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Erro: A transação foi rejeitada. Isso poderá acontecer se algumas das moedas na sua carteira já tiverem sido gastas, se por exemplo tiver usado uma cópia do ficheiro wallet.dat e as moedas foram gastas na cópia mas não foram marcadas como gastas aqui.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>Erro: Esta transação requer uma taxa de transação mínima de %s devido á sua quantia, complexidade, ou uso de fundos recebidos recentemente! </translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Executar comando quando um alerta relevante for recebido (no comando, %s é substituído pela mensagem)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Executar comando quando uma das transações na carteira mudar (no comando, %s é substituído pelo ID da Transação)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Definir tamanho máximo de transações de alta-/baixa-prioridade em bytes (por defeito: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Esta é uma versão de pré-lançamento - use à sua responsabilidade - não usar para minar ou aplicações comerciais</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Atenção: -paytxfee está definida com um valor muito alto! Esta é a taxa que irá pagar se enviar uma transação.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Atenção: As transações mostradas poderão não estar correctas! Poderá ter que atualizar ou outros nós poderão ter que atualizar.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Litecoin will not work properly.</source> <translation>Atenção: Por favor verifique que a data e hora do seu computador estão correctas! Se o seu relógio não estiver certo o Peacecoin não irá funcionar correctamente.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Atenção: erro ao ler wallet.dat! Todas as chaves foram lidas correctamente, mas dados de transação ou do livro de endereços podem estar em falta ou incorrectos.</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Atenção: wallet.dat corrupto, dados recuperados! wallet.dat original salvo como wallet.{timestamp}.bak em %s; se o seu saldo ou transações estiverem incorrectos deverá recuperar de uma cópia de segurança.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tentar recuperar chaves privadas de um wallet.dat corrupto</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Opções de criação de bloco:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Apenas ligar ao(s) nó(s) especificado(s)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Cadeia de blocos corrompida detectada</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Descobrir endereço IP próprio (padrão: 1 ao escutar e sem -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Deseja reconstruir agora a cadeia de blocos?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Erro ao inicializar a cadeia de blocos</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Erro ao inicializar o ambiente de base de dados da carteira %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Erro ao carregar cadeia de blocos</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Erro ao abrir a cadeia de blocos</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Erro: Pouco espaço em disco!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Erro: Carteira bloqueada, incapaz de criar transação! </translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Erro: erro do sistema:</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Falhou a escutar em qualquer porta. Use -listen=0 se quer isto.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>Falha ao ler info do bloco</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>Falha ao ler bloco</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>Falha ao sincronizar índice do bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>Falha ao escrever índice do bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>Falha ao escrever info do bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Falha ao escrever o bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>Falha ao escrever info do ficheiro</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>Falha ao escrever na base de dados de moedas</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>Falha ao escrever índice de transações</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>Falha ao escrever histórico de modificações</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Encontrar pares usando procura DNS (por defeito: 1 excepto -connect)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Gerar moedas (por defeito: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Quantos blocos verificar ao começar (por defeito: 288, 0 = todos)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Qual a minúcia na verificação de blocos (0-4, por defeito: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>Descritores de ficheiros disponíveis são insuficientes.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Reconstruir a cadeia de blocos dos ficheiros blk000??.dat actuais</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Defina o número de processos para servir as chamadas RPC (por defeito: 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Verificando blocos...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Verificando a carteira...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Importar blocos de um ficheiro blk000??.dat externo</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Defina o número de processos de verificação (até 16, 0 = automático, &lt;0 = disponibiliza esse número de núcleos livres, por defeito: 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>Informação</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Endereço -tor inválido: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantia inválida para -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantia inválida para -mintxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Manter índice de transações completo (por defeito: 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Armazenamento intermédio de recepção por ligação, &lt;n&gt;*1000 bytes (por defeito: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Armazenamento intermédio de envio por ligação, &lt;n&gt;*1000 bytes (por defeito: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Apenas aceitar cadeia de blocos coincidente com marcas de verificação internas (por defeito: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Apenas ligar a nós na rede &lt;net&gt; (IPv4, IPv6 ou Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Produzir informação de depuração extra. Implica todas as outras opções -debug*</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Produzir informação de depuração extraordinária</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Preceder informação de depuração com selo temporal</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Litecoin Wiki for SSL setup instructions)</source> <translation>Opções SSL: (ver a Wiki Peacecoin para instruções de configuração SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Selecione a versão do proxy socks a usar (4-5, padrão: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Enviar informação de rastreio/depuração para a consola e não para o ficheiro debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Enviar informação de rastreio/depuração para o depurador</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Definir tamanho máximo de um bloco em bytes (por defeito: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Definir tamanho minímo de um bloco em bytes (por defeito: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Encolher ficheiro debug.log ao iniciar o cliente (por defeito: 1 sem -debug definido)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>Falhou assinatura da transação</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Especificar tempo de espera da ligação em millisegundos (por defeito: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Erro de sistema:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>Quantia da transação é muito baixa</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Quantia da transação deverá ser positiva</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Transação grande demais</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Usar UPnP para mapear a porta de escuta (padrão: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Usar UPnP para mapear a porta de escuta (padrão: 1 ao escutar)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Utilizar proxy para aceder a serviços escondidos Tor (por defeito: mesmo que -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Nome de utilizador para ligações JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Atenção: Esta versão está obsoleta, é necessário actualizar!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>Necessita reconstruir as bases de dados usando -reindex para mudar -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupta, recuperação falhou</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Palavra-passe para ligações JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitir ligações JSON-RPC do endereço IP especificado</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Enviar comandos para o nó a correr em &lt;ip&gt; (por defeito: 127.0.0.1)</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Executar comando quando mudar o melhor bloco (no comando, %s é substituído pela hash do bloco)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Atualize a carteira para o formato mais recente</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Definir o tamanho da memória de chaves para &lt;n&gt; (por defeito: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Reexaminar a cadeia de blocos para transações em falta na carteira</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para ligações JSON-RPC</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Ficheiro de certificado do servidor (por defeito: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Chave privada do servidor (por defeito: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Cifras aceitáveis (por defeito: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Esta mensagem de ajuda</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Incapaz de vincular a %s neste computador (vínculo retornou erro %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Ligar através de um proxy socks</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir procuras DNS para -addnode, -seednode e -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Carregar endereços...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erro ao carregar wallet.dat: Carteira danificada</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Litecoin</source> <translation>Erro ao carregar wallet.dat: A Carteira requer uma versão mais recente do Peacecoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Litecoin to complete</source> <translation>A Carteira precisou ser reescrita: reinicie o Peacecoin para completar</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Erro ao carregar wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Endereço -proxy inválido: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Rede desconhecida especificada em -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Versão desconhecida de proxy -socks requisitada: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Não conseguiu resolver endereço -bind: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Não conseguiu resolver endereço -externalip: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantia inválida para -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Quantia inválida</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Fundos insuficientes</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Carregar índice de blocos...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Adicione um nó ao qual se ligar e tentar manter a ligação aberta</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Litecoin is probably already running.</source> <translation>Incapaz de vincular à porta %s neste computador. Provavelmente o Peacecoin já está a funcionar.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Taxa por KB a adicionar a transações enviadas</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Carregar carteira...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Impossível mudar a carteira para uma versão anterior</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Impossível escrever endereço por defeito</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Reexaminando...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Carregamento completo</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Para usar a opção %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Deverá definir rpcpassword=&lt;password&gt; no ficheiro de configuração: %s Se o ficheiro não existir, crie-o com permissões de leitura apenas para o dono.</translation> </message> </context> </TS>
TheBitCoder/Peacecoin
src/qt/locale/bitcoin_pt_PT.ts
TypeScript
mit
118,867
// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2007-2019 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // This file was modified by Oracle on 2016. // Modifications copyright (c) 2016, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include <boost/variant/variant.hpp> #include "geometry_test_common.hpp" #include <boost/geometry/algorithms/buffer.hpp> #include <boost/geometry/algorithms/equals.hpp> #include <boost/geometry/core/coordinate_type.hpp> #include <boost/geometry/strategies/strategies.hpp> #include <boost/geometry/geometries/point.hpp> #include <boost/geometry/geometries/box.hpp> #include "test_common/test_point.hpp" template <typename P> void test_all() { typedef typename bg::coordinate_type<P>::type coordinate_type; P p1(0, 0); P p2(2, 2); typedef bg::model::box<P> box_type; box_type b1(p1, p2); box_type b2; bg::buffer(b1, b2, coordinate_type(2)); box_type expected(P(-2, -2), P(4, 4)); BOOST_CHECK(bg::equals(b2, expected)); boost::variant<box_type> v(b1); bg::buffer(v, b2, coordinate_type(2)); BOOST_CHECK(bg::equals(b2, expected)); } int test_main(int, char* []) { BoostGeometryWriteTestConfiguration(); test_all<bg::model::point<default_test_type, 2, bg::cs::cartesian> >(); #if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) test_all<bg::model::point<int, 2, bg::cs::cartesian> >(); test_all<bg::model::point<float, 2, bg::cs::cartesian> >(); #endif return 0; }
davehorton/drachtio-server
deps/boost_1_77_0/libs/geometry/test/algorithms/buffer/buffer.cpp
C++
mit
2,019
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Phaser Source: src/physics/p2/GearConstraint.js</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/default.css"> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div style="position: absolute; width: 143px; height: 31px; right: 10px; top: 10px; z-index: 1050"><a href="http://phaser.io"><img src="img/phaser.png" border="0" /></a></div> <div class="navbar-inner"> <a class="brand" href="index.html">Phaser API</a> <ul class="nav"> <li class="dropdown"> <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="Phaser.html">Phaser</a> </li> <li class="class-depth-0"> <a href="PIXI.html">PIXI</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="EarCut.html">EarCut</a> </li> <li class="class-depth-0"> <a href="Event.html">Event</a> </li> <li class="class-depth-0"> <a href="EventTarget.html">EventTarget</a> </li> <li class="class-depth-1"> <a href="Phaser.Animation.html">Animation</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationManager.html">AnimationManager</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationParser.html">AnimationParser</a> </li> <li class="class-depth-1"> <a href="Phaser.ArraySet.html">ArraySet</a> </li> <li class="class-depth-1"> <a href="Phaser.ArrayUtils.html">ArrayUtils</a> </li> <li class="class-depth-1"> <a href="Phaser.AudioSprite.html">AudioSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapData.html">BitmapData</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapText.html">BitmapText</a> </li> <li class="class-depth-1"> <a href="Phaser.Bullet.html">Bullet</a> </li> <li class="class-depth-1"> <a href="Phaser.Button.html">Button</a> </li> <li class="class-depth-1"> <a href="Phaser.Cache.html">Cache</a> </li> <li class="class-depth-1"> <a href="Phaser.Camera.html">Camera</a> </li> <li class="class-depth-1"> <a href="Phaser.Canvas.html">Canvas</a> </li> <li class="class-depth-1"> <a href="Phaser.CanvasPool.html">CanvasPool</a> </li> <li class="class-depth-1"> <a href="Phaser.Circle.html">Circle</a> </li> <li class="class-depth-1"> <a href="Phaser.Color.html">Color</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Angle.html">Angle</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Animation.html">Animation</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.AutoCull.html">AutoCull</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Bounds.html">Bounds</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.BringToTop.html">BringToTop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Core.html">Core</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Crop.html">Crop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Delta.html">Delta</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Destroy.html">Destroy</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.FixedToCamera.html">FixedToCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Health.html">Health</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InCamera.html">InCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InputEnabled.html">InputEnabled</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InWorld.html">InWorld</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LifeSpan.html">LifeSpan</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LoadTexture.html">LoadTexture</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Overlap.html">Overlap</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.PhysicsBody.html">PhysicsBody</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Reset.html">Reset</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.ScaleMinMax.html">ScaleMinMax</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Smoothed.html">Smoothed</a> </li> <li class="class-depth-1"> <a href="Phaser.Create.html">Create</a> </li> <li class="class-depth-1"> <a href="Phaser.Creature.html">Creature</a> </li> <li class="class-depth-1"> <a href="Phaser.Device.html">Device</a> </li> <li class="class-depth-1"> <a href="Phaser.DeviceButton.html">DeviceButton</a> </li> <li class="class-depth-1"> <a href="Phaser.DOM.html">DOM</a> </li> <li class="class-depth-1"> <a href="Phaser.Easing.html">Easing</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Back.html">Back</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Bounce.html">Bounce</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Circular.html">Circular</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Cubic.html">Cubic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Elastic.html">Elastic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Exponential.html">Exponential</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Linear.html">Linear</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quadratic.html">Quadratic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quartic.html">Quartic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quintic.html">Quintic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> </li> <li class="class-depth-1"> <a href="Phaser.Ellipse.html">Ellipse</a> </li> <li class="class-depth-1"> <a href="Phaser.Events.html">Events</a> </li> <li class="class-depth-1"> <a href="Phaser.Filter.html">Filter</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexGrid.html">FlexGrid</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexLayer.html">FlexLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.Frame.html">Frame</a> </li> <li class="class-depth-1"> <a href="Phaser.FrameData.html">FrameData</a> </li> <li class="class-depth-1"> <a href="Phaser.Game.html">Game</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectCreator.html">GameObjectCreator</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> </li> <li class="class-depth-1"> <a href="Phaser.Gamepad.html">Gamepad</a> </li> <li class="class-depth-1"> <a href="Phaser.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="Phaser.Group.html">Group</a> </li> <li class="class-depth-1"> <a href="Phaser.Hermite.html">Hermite</a> </li> <li class="class-depth-1"> <a href="Phaser.Image.html">Image</a> </li> <li class="class-depth-1"> <a href="Phaser.ImageCollection.html">ImageCollection</a> </li> <li class="class-depth-1"> <a href="Phaser.Input.html">Input</a> </li> <li class="class-depth-1"> <a href="Phaser.InputHandler.html">InputHandler</a> </li> <li class="class-depth-1"> <a href="Phaser.Key.html">Key</a> </li> <li class="class-depth-1"> <a href="Phaser.Keyboard.html">Keyboard</a> </li> <li class="class-depth-1"> <a href="Phaser.KeyCode.html">KeyCode</a> </li> <li class="class-depth-1"> <a href="Phaser.Line.html">Line</a> </li> <li class="class-depth-1"> <a href="Phaser.LinkedList.html">LinkedList</a> </li> <li class="class-depth-1"> <a href="Phaser.Loader.html">Loader</a> </li> <li class="class-depth-1"> <a href="Phaser.LoaderParser.html">LoaderParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Math.html">Math</a> </li> <li class="class-depth-1"> <a href="Phaser.Matrix.html">Matrix</a> </li> <li class="class-depth-1"> <a href="Phaser.Mouse.html">Mouse</a> </li> <li class="class-depth-1"> <a href="Phaser.MSPointer.html">MSPointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Net.html">Net</a> </li> <li class="class-depth-1"> <a href="Phaser.Particle.html">Particle</a> </li> <li class="class-depth-1"> <a href="Phaser.Particles.html">Particles</a> </li> <li class="class-depth-2"> <a href="Phaser.Particles.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a> </li> <li class="class-depth-1"> <a href="Phaser.Path.html">Path</a> </li> <li class="class-depth-1"> <a href="Phaser.PathFollower.html">PathFollower</a> </li> <li class="class-depth-1"> <a href="Phaser.PathPoint.html">PathPoint</a> </li> <li class="class-depth-1"> <a href="Phaser.Physics.html">Physics</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.TilemapCollision.html">TilemapCollision</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Ninja.html">Ninja</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.AABB.html">AABB</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Circle.html">Circle</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Tile.html">Tile</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.P2.html">P2</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.FixtureList.html">FixtureList</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Material.html">Material</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Spring.html">Spring</a> </li> <li class="class-depth-1"> <a href="Phaser.Plugin.html">Plugin</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.AStar.html">AStar</a> </li> <li class="class-depth-3"> <a href="Phaser.Plugin.AStar.AStarNode.html">AStarNode</a> </li> <li class="class-depth-3"> <a href="Phaser.Plugin.AStar.AStarPath.html">AStarPath</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.ColorHarmony.html">ColorHarmony</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.CSS3Filters.html">CSS3Filters</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.Juicy.html">Juicy</a> </li> <li class="class-depth-3"> <a href="Phaser.Plugin.Juicy.ScreenFlash.html">ScreenFlash</a> </li> <li class="class-depth-3"> <a href="Phaser.Plugin.Juicy.Trail.html">Trail</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.KineticScrolling.html">KineticScrolling</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.PathManager.html">PathManager</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.SamplePlugin.html">SamplePlugin</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.TilemapWalker.html">TilemapWalker</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.VirtualJoystick.html">VirtualJoystick</a> </li> <li class="class-depth-2"> <a href="Phaser.Plugin.Webcam.html">Webcam</a> </li> <li class="class-depth-1"> <a href="Phaser.PluginManager.html">PluginManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Point.html">Point</a> </li> <li class="class-depth-1"> <a href="Phaser.Pointer.html">Pointer</a> </li> <li class="class-depth-1"> <a href="Phaser.PointerMode.html">PointerMode</a> </li> <li class="class-depth-1"> <a href="Phaser.Polygon.html">Polygon</a> </li> <li class="class-depth-1"> <a href="Phaser.QuadTree.html">QuadTree</a> </li> <li class="class-depth-1"> <a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a> </li> <li class="class-depth-1"> <a href="Phaser.Rectangle.html">Rectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> </li> <li class="class-depth-1"> <a href="Phaser.RetroFont.html">RetroFont</a> </li> <li class="class-depth-1"> <a href="Phaser.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="Phaser.RoundedRectangle.html">RoundedRectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.ScaleManager.html">ScaleManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Signal.html">Signal</a> </li> <li class="class-depth-1"> <a href="Phaser.SignalBinding.html">SignalBinding</a> </li> <li class="class-depth-1"> <a href="Phaser.SinglePad.html">SinglePad</a> </li> <li class="class-depth-1"> <a href="Phaser.Sound.html">Sound</a> </li> <li class="class-depth-1"> <a href="Phaser.SoundManager.html">SoundManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="Phaser.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="Phaser.Stage.html">Stage</a> </li> <li class="class-depth-1"> <a href="Phaser.State.html">State</a> </li> <li class="class-depth-1"> <a href="Phaser.StateManager.html">StateManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Text.html">Text</a> </li> <li class="class-depth-1"> <a href="Phaser.Tile.html">Tile</a> </li> <li class="class-depth-1"> <a href="Phaser.Tilemap.html">Tilemap</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapLayer.html">TilemapLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapParser.html">TilemapParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Tileset.html">Tileset</a> </li> <li class="class-depth-1"> <a href="Phaser.TileSprite.html">TileSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.Time.html">Time</a> </li> <li class="class-depth-1"> <a href="Phaser.Timer.html">Timer</a> </li> <li class="class-depth-1"> <a href="Phaser.TimerEvent.html">TimerEvent</a> </li> <li class="class-depth-1"> <a href="Phaser.Touch.html">Touch</a> </li> <li class="class-depth-1"> <a href="Phaser.Tween.html">Tween</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenData.html">TweenData</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenManager.html">TweenManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Utils.html">Utils</a> </li> <li class="class-depth-2"> <a href="Phaser.Utils.Debug.html">Debug</a> </li> <li class="class-depth-1"> <a href="Phaser.Video.html">Video</a> </li> <li class="class-depth-1"> <a href="Phaser.Weapon.html">Weapon</a> </li> <li class="class-depth-1"> <a href="Phaser.World.html">World</a> </li> <li class="class-depth-1"> <a href="PIXI.BaseTexture.html">BaseTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasBuffer.html">CanvasBuffer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasGraphics.html">CanvasGraphics</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasMaskManager.html">CanvasMaskManager</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasRenderer.html">CanvasRenderer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasTinter.html">CanvasTinter</a> </li> <li class="class-depth-1"> <a href="PIXI.ComplexPrimitiveShader.html">ComplexPrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.DisplayObject.html">DisplayObject</a> </li> <li class="class-depth-1"> <a href="PIXI.DisplayObjectContainer.html">DisplayObjectContainer</a> </li> <li class="class-depth-1"> <a href="PIXI.FilterTexture.html">FilterTexture</a> </li> <li class="class-depth-2"> <a href="PIXI.Phaser.GraphicsData.html">Phaser.GraphicsData</a> </li> <li class="class-depth-1"> <a href="PIXI.PIXI.html">PIXI</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiFastShader.html">PixiFastShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiShader.html">PixiShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PrimitiveShader.html">PrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="PIXI.StripShader.html">StripShader</a> </li> <li class="class-depth-1"> <a href="PIXI.Texture.html">Texture</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLBlendModeManager.html">WebGLBlendModeManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFastSpriteBatch.html">WebGLFastSpriteBatch</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFilterManager.html">WebGLFilterManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLRenderer.html">WebGLRenderer</a> </li> </ul> </li> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="global.html#ANGLE_DOWN">ANGLE_DOWN</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_LEFT">ANGLE_LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_NORTH_EAST">ANGLE_NORTH_EAST</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_NORTH_WEST">ANGLE_NORTH_WEST</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_RIGHT">ANGLE_RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_SOUTH_EAST">ANGLE_SOUTH_EAST</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_SOUTH_WEST">ANGLE_SOUTH_WEST</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_UP">ANGLE_UP</a> </li> <li class="class-depth-0"> <a href="global.html#arc">arc</a> </li> <li class="class-depth-0"> <a href="global.html#AUTO">AUTO</a> </li> <li class="class-depth-0"> <a href="global.html#beginFill">beginFill</a> </li> <li class="class-depth-0"> <a href="global.html#bezierCurveTo">bezierCurveTo</a> </li> <li class="class-depth-0"> <a href="global.html#BITMAPDATA">BITMAPDATA</a> </li> <li class="class-depth-0"> <a href="global.html#BITMAPTEXT">BITMAPTEXT</a> </li> <li class="class-depth-0"> <a href="global.html#blendModes">blendModes</a> </li> <li class="class-depth-0"> <a href="global.html#BOTTOM_CENTER">BOTTOM_CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#BOTTOM_LEFT">BOTTOM_LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#BOTTOM_RIGHT">BOTTOM_RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#BUTTON">BUTTON</a> </li> <li class="class-depth-0"> <a href="global.html#CANVAS">CANVAS</a> </li> <li class="class-depth-0"> <a href="global.html#CANVAS_FILTER">CANVAS_FILTER</a> </li> <li class="class-depth-0"> <a href="global.html#CENTER">CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#CIRCLE">CIRCLE</a> </li> <li class="class-depth-0"> <a href="global.html#clear">clear</a> </li> <li class="class-depth-0"> <a href="global.html#CREATURE">CREATURE</a> </li> <li class="class-depth-0"> <a href="global.html#destroyCachedSprite">destroyCachedSprite</a> </li> <li class="class-depth-0"> <a href="global.html#displayList">displayList</a> </li> <li class="class-depth-0"> <a href="global.html#DOWN">DOWN</a> </li> <li class="class-depth-0"> <a href="global.html#drawCircle">drawCircle</a> </li> <li class="class-depth-0"> <a href="global.html#drawEllipse">drawEllipse</a> </li> <li class="class-depth-0"> <a href="global.html#drawPolygon">drawPolygon</a> </li> <li class="class-depth-0"> <a href="global.html#drawRect">drawRect</a> </li> <li class="class-depth-0"> <a href="global.html#drawRoundedRect">drawRoundedRect</a> </li> <li class="class-depth-0"> <a href="global.html#drawShape">drawShape</a> </li> <li class="class-depth-0"> <a href="global.html#ELLIPSE">ELLIPSE</a> </li> <li class="class-depth-0"> <a href="global.html#emit">emit</a> </li> <li class="class-depth-0"> <a href="global.html#EMITTER">EMITTER</a> </li> <li class="class-depth-0"> <a href="global.html#endFill">endFill</a> </li> <li class="class-depth-0"> <a href="global.html#GAMES">GAMES</a> </li> <li class="class-depth-0"> <a href="global.html#generateTexture">generateTexture</a> </li> <li class="class-depth-0"> <a href="global.html#getBounds">getBounds</a> </li> <li class="class-depth-0"> <a href="global.html#getLocalBounds">getLocalBounds</a> </li> <li class="class-depth-0"> <a href="global.html#GRAPHICS">GRAPHICS</a> </li> <li class="class-depth-0"> <a href="global.html#GROUP">GROUP</a> </li> <li class="class-depth-0"> <a href="global.html#HEADLESS">HEADLESS</a> </li> <li class="class-depth-0"> <a href="global.html#HORIZONTAL">HORIZONTAL</a> </li> <li class="class-depth-0"> <a href="global.html#IMAGE">IMAGE</a> </li> <li class="class-depth-0"> <a href="global.html#LANDSCAPE">LANDSCAPE</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT">LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT_BOTTOM">LEFT_BOTTOM</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT_CENTER">LEFT_CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT_TOP">LEFT_TOP</a> </li> <li class="class-depth-0"> <a href="global.html#LINE">LINE</a> </li> <li class="class-depth-0"> <a href="global.html#lineStyle">lineStyle</a> </li> <li class="class-depth-0"> <a href="global.html#lineTo">lineTo</a> </li> <li class="class-depth-0"> <a href="global.html#listeners">listeners</a> </li> <li class="class-depth-0"> <a href="global.html#MATRIX">MATRIX</a> </li> <li class="class-depth-0"> <a href="global.html#mixin">mixin</a> </li> <li class="class-depth-0"> <a href="global.html#moveTo">moveTo</a> </li> <li class="class-depth-0"> <a href="global.html#NONE">NONE</a> </li> <li class="class-depth-0"> <a href="global.html#off">off</a> </li> <li class="class-depth-0"> <a href="global.html#on">on</a> </li> <li class="class-depth-0"> <a href="global.html#once">once</a> </li> <li class="class-depth-0"> <a href="global.html#PENDING_ATLAS">PENDING_ATLAS</a> </li> <li class="class-depth-2"> <a href="global.html#Phaser.Path#numPointsreturn%257Bnumber%257DThetotalnumberofPathPointsinthisPath.">Phaser.Path#numPoints return {number} The total number of PathPoints in this Path.</a> </li> <li class="class-depth-0"> <a href="global.html#POINT">POINT</a> </li> <li class="class-depth-0"> <a href="global.html#POINTER">POINTER</a> </li> <li class="class-depth-0"> <a href="global.html#POLYGON">POLYGON</a> </li> <li class="class-depth-0"> <a href="global.html#PORTRAIT">PORTRAIT</a> </li> <li class="class-depth-0"> <a href="global.html#quadraticCurveTo">quadraticCurveTo</a> </li> <li class="class-depth-0"> <a href="global.html#RECTANGLE">RECTANGLE</a> </li> <li class="class-depth-0"> <a href="global.html#removeAllListeners">removeAllListeners</a> </li> <li class="class-depth-0"> <a href="global.html#RENDERTEXTURE">RENDERTEXTURE</a> </li> <li class="class-depth-0"> <a href="global.html#RETROFONT">RETROFONT</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT">RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT_BOTTOM">RIGHT_BOTTOM</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT_CENTER">RIGHT_CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT_TOP">RIGHT_TOP</a> </li> <li class="class-depth-0"> <a href="global.html#ROPE">ROPE</a> </li> <li class="class-depth-0"> <a href="global.html#ROUNDEDRECTANGLE">ROUNDEDRECTANGLE</a> </li> <li class="class-depth-0"> <a href="global.html#scaleModes">scaleModes</a> </li> <li class="class-depth-0"> <a href="global.html#set">set</a> </li> <li class="class-depth-0"> <a href="global.html#SPRITE">SPRITE</a> </li> <li class="class-depth-0"> <a href="global.html#SPRITEBATCH">SPRITEBATCH</a> </li> <li class="class-depth-0"> <a href="global.html#stopImmediatePropagation">stopImmediatePropagation</a> </li> <li class="class-depth-0"> <a href="global.html#stopPropagation">stopPropagation</a> </li> <li class="class-depth-0"> <a href="global.html#TEXT">TEXT</a> </li> <li class="class-depth-0"> <a href="global.html#TILEMAP">TILEMAP</a> </li> <li class="class-depth-0"> <a href="global.html#TILEMAPLAYER">TILEMAPLAYER</a> </li> <li class="class-depth-0"> <a href="global.html#TILESPRITE">TILESPRITE</a> </li> <li class="class-depth-0"> <a href="global.html#TOP_CENTER">TOP_CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#TOP_LEFT">TOP_LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#TOP_RIGHT">TOP_RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#UP">UP</a> </li> <li class="class-depth-0"> <a href="global.html#updateLocalBounds">updateLocalBounds</a> </li> <li class="class-depth-0"> <a href="global.html#VERSION">VERSION</a> </li> <li class="class-depth-0"> <a href="global.html#VERTICAL">VERTICAL</a> </li> <li class="class-depth-0"> <a href="global.html#VIDEO">VIDEO</a> </li> <li class="class-depth-0"> <a href="global.html#WEBGL">WEBGL</a> </li> <li class="class-depth-0"> <a href="global.html#WEBGL_FILTER">WEBGL_FILTER</a> </li> <li class="class-depth-0"> <a href="global.html#WEBGL_MULTI">WEBGL_MULTI</a> </li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Core<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Game.html">Game</a></li> <li class="class-depth-1"><a href="Phaser.Group.html">Group</a></li> <li class="class-depth-1"><a href="Phaser.World.html">World</a></li> <li class="class-depth-1"><a href="Phaser.Loader.html">Loader</a></li> <li class="class-depth-1"><a href="Phaser.Cache.html">Cache</a></li> <li class="class-depth-1"><a href="Phaser.Time.html">Time</a></li> <li class="class-depth-1"><a href="Phaser.Camera.html">Camera</a></li> <li class="class-depth-1"><a href="Phaser.StateManager.html">State Manager</a></li> <li class="class-depth-1"><a href="Phaser.TweenManager.html">Tween Manager</a></li> <li class="class-depth-1"><a href="Phaser.SoundManager.html">Sound Manager</a></li> <li class="class-depth-1"><a href="Phaser.Input.html">Input Manager</a></li> <li class="class-depth-1"><a href="Phaser.ScaleManager.html">Scale Manager</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Game Objects<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.GameObjectFactory.html">Factory (game.add)</a></li> <li class="class-depth-1"><a href="Phaser.GameObjectCreator.html">Creator (game.make)</a></li> <li class="class-depth-1"><a href="Phaser.Sprite.html">Sprite</a></li> <li class="class-depth-1"><a href="Phaser.Image.html">Image</a></li> <li class="class-depth-1"><a href="Phaser.Sound.html">Sound</a></li> <li class="class-depth-1"><a href="Phaser.Video.html">Video</a></li> <li class="class-depth-1"><a href="Phaser.Particles.Arcade.Emitter.html">Particle Emitter</a></li> <li class="class-depth-1"><a href="Phaser.Particle.html">Particle</a></li> <li class="class-depth-1"><a href="Phaser.Text.html">Text</a></li> <li class="class-depth-1"><a href="Phaser.Tween.html">Tween</a></li> <li class="class-depth-1"><a href="Phaser.BitmapText.html">BitmapText</a></li> <li class="class-depth-1"><a href="Phaser.Tilemap.html">Tilemap</a></li> <li class="class-depth-1"><a href="Phaser.BitmapData.html">BitmapData</a></li> <li class="class-depth-1"><a href="Phaser.RetroFont.html">RetroFont</a></li> <li class="class-depth-1"><a href="Phaser.Button.html">Button</a></li> <li class="class-depth-1"><a href="Phaser.Animation.html">Animation</a></li> <li class="class-depth-1"><a href="Phaser.Graphics.html">Graphics</a></li> <li class="class-depth-1"><a href="Phaser.RenderTexture.html">RenderTexture</a></li> <li class="class-depth-1"><a href="Phaser.TileSprite.html">TileSprite</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Geometry<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Circle.html">Circle</a></li> <li class="class-depth-1"><a href="Phaser.Ellipse.html">Ellipse</a></li> <li class="class-depth-1"><a href="Phaser.Line.html">Line</a></li> <li class="class-depth-1"><a href="Phaser.Matrix.html">Matrix</a></li> <li class="class-depth-1"><a href="Phaser.Point.html">Point</a></li> <li class="class-depth-1"><a href="Phaser.Polygon.html">Polygon</a></li> <li class="class-depth-1"><a href="Phaser.Rectangle.html">Rectangle</a></li> <li class="class-depth-1"><a href="Phaser.RoundedRectangle.html">Rounded Rectangle</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Physics<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Physics.Arcade.html">Arcade Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Arcade.Body.html">Body</a></li> <li class="class-depth-2"><a href="Phaser.Weapon.html">Weapon</a></li> <li class="class-depth-1"><a href="Phaser.Physics.P2.html">P2 Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Body.html">Body</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Spring.html">Spring</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a></li> <li class="class-depth-1"><a href="Phaser.Physics.Ninja.html">Ninja Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Body.html">Body</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Input<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.InputHandler.html">Input Handler</a></li> <li class="class-depth-1"><a href="Phaser.Pointer.html">Pointer</a></li> <li class="class-depth-1"><a href="Phaser.DeviceButton.html">Device Button</a></li> <li class="class-depth-1"><a href="Phaser.Mouse.html">Mouse</a></li> <li class="class-depth-1"><a href="Phaser.Keyboard.html">Keyboard</a></li> <li class="class-depth-1"><a href="Phaser.Key.html">Key</a></li> <li class="class-depth-1"><a href="Phaser.KeyCode.html">Key Codes</a></li> <li class="class-depth-1"><a href="Phaser.Gamepad.html">Gamepad</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="http://phaser.io">Phaser Web Site</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser">Phaser Github</a></li> <li class="class-depth-1"><a href="http://phaser.io/examples">Phaser Examples</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser-plugins">Phaser Plugins</a></li> <li class="class-depth-1"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Forum</a></li> <li class="class-depth-1"><a href="http://stackoverflow.com/questions/tagged/phaser-framework">Stack Overflow</a></li> <li class="class-depth-1"><a href="http://phaser.io/learn">Tutorials</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/newsletter">Newsletter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/twitter">Twitter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/slack">Slack</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/donate">Donate</a></li> <li class="class-depth-1"><a href="https://www.codeandweb.com/texturepacker/phaser">Texture Packer</a></li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span12"> <div id="main"> <h1 class="page-title">Source: src/physics/p2/GearConstraint.js</h1> <section> <article> <pre class="sunlight-highlight-javascript linenums">/** * @author Richard Davey &lt;[email protected]> * @copyright 2016 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ /** * Connects two bodies at given offset points, letting them rotate relative to each other around this point. * * @class Phaser.Physics.P2.GearConstraint * @constructor * @param {Phaser.Physics.P2} world - A reference to the P2 World. * @param {p2.Body} bodyA - First connected body. * @param {p2.Body} bodyB - Second connected body. * @param {number} [angle=0] - The relative angle * @param {number} [ratio=1] - The gear ratio. */ Phaser.Physics.P2.GearConstraint = function (world, bodyA, bodyB, angle, ratio) { if (angle === undefined) { angle = 0; } if (ratio === undefined) { ratio = 1; } /** * @property {Phaser.Game} game - Local reference to game. */ this.game = world.game; /** * @property {Phaser.Physics.P2} world - Local reference to P2 World. */ this.world = world; var options = { angle: angle, ratio: ratio }; p2.GearConstraint.call(this, bodyA, bodyB, options); }; Phaser.Physics.P2.GearConstraint.prototype = Object.create(p2.GearConstraint.prototype); Phaser.Physics.P2.GearConstraint.prototype.constructor = Phaser.Physics.P2.GearConstraint; </pre> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="copyright"> Phaser Copyright © 2012-2016 Photon Storm Ltd. </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed Apr 19 2017 21:51:46 GMT-0700 (PDT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> </div> <br clear="both"> </div> </div> <script src="scripts/sunlight.js"></script> <script src="scripts/sunlight.javascript.js"></script> <script src="scripts/sunlight-plugin.doclinks.js"></script> <script src="scripts/sunlight-plugin.linenumbers.js"></script> <script src="scripts/sunlight-plugin.menu.js"></script> <script src="scripts/jquery.min.js"></script> <script src="scripts/jquery.scrollTo.js"></script> <script src="scripts/jquery.localScroll.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script> <script> $( function () { $( "#toc" ).toc( { anchorName : function(i, heading, prefix) { return $(heading).attr("id") || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : 60 } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); } ); </script> </body> </html>
kPlusPlus/GameK
node_modules/phaser-ce/docs/src_physics_p2_GearConstraint.js.html
HTML
mit
44,200
module Test where import Test.QuickCheck (Property, (==>)) import Submission (celsiusToFarenheit, nCopies, numEvens, numManyEvens) import qualified Submission as Soln (celsiusToFarenheit, nCopies, numEvens, numManyEvens) prop_celsius0 :: Bool prop_celsius0 = celsiusToFarenheit 0 == 32 prop_celsius37 :: Bool prop_celsius37 = celsiusToFarenheit 37 == 99 prop_nCopiesLength :: [Char] -> Int -> Property prop_nCopiesLength s n = n >= 0 ==> (length (nCopies s n) == (length s) * n) prop_numEvensLength :: [Int] -> Bool prop_numEvensLength nums = numEvens nums <= length nums -- | What do you think this property says? prop_numManyEvensDoubled :: [[Int]] -> Bool prop_numManyEvensDoubled listsOfNums = let doubled = listsOfNums ++ listsOfNums in numManyEvens doubled == 2 * (numManyEvens listsOfNums) prop_celsiusAgainstReference :: Float -> Bool prop_celsiusAgainstReference x = celsiusToFarenheit x == Soln.celsiusToFarenheit x prop_nCopiesAgainstReference :: [Char] -> Int -> Property prop_nCopiesAgainstReference s x = x >= 0 ==> nCopies s x == Soln.nCopies s x prop_numEvensAgainstReference :: [Int] -> Bool prop_numEvensAgainstReference x = numEvens x == Soln.numEvens x prop_numManyEvensAgainstReference :: [[Int]] -> Bool prop_numManyEvensAgainstReference x = numManyEvens x == Soln.numManyEvens x -- main :: IO () -- main = do -- quickCheck prop_celsius0 -- quickCheck prop_celsius37 -- quickCheck prop_nCopiesLength -- quickCheck prop_numEvensLength -- quickCheck prop_numManyEvensDoubled -- quickCheck prop_celsiusAgainstReference -- quickCheck prop_nCopiesAgainstReference -- quickCheck prop_numEvensAgainstReference -- quickCheck prop_numManyEvensAgainstReference
benjaminvialle/Markus
db/data/autotest_files/haskell/script_files/Test.hs
Haskell
mit
1,745
require 'bundler/dependency' module Bundler class Dsl def self.evaluate(gemfile, lockfile, unlock) builder = new builder.instance_eval(Bundler.read_file(gemfile.to_s), gemfile.to_s, 1) builder.to_definition(lockfile, unlock) end VALID_PLATFORMS = Bundler::Dependency::PLATFORM_MAP.keys.freeze def initialize @rubygems_source = Source::Rubygems.new @source = nil @sources = [] @dependencies = [] @groups = [] @platforms = [] @env = nil end def gemspec(opts = nil) path = opts && opts[:path] || '.' name = opts && opts[:name] || '{,*}' development_group = opts && opts[:development_group] || :development path = File.expand_path(path, Bundler.default_gemfile.dirname) gemspecs = Dir[File.join(path, "#{name}.gemspec")] case gemspecs.size when 1 spec = Bundler.load_gemspec(gemspecs.first) raise InvalidOption, "There was an error loading the gemspec at #{gemspecs.first}." unless spec gem spec.name, :path => path group(development_group) do spec.development_dependencies.each do |dep| gem dep.name, *(dep.requirement.as_list + [:type => :development]) end end when 0 raise InvalidOption, "There are no gemspecs at #{path}." else raise InvalidOption, "There are multiple gemspecs at #{path}. Please use the :name option to specify which one." end end def gem(name, *args) if name.is_a?(Symbol) raise GemfileError, %{You need to specify gem names as Strings. Use 'gem "#{name.to_s}"' instead.} end options = Hash === args.last ? args.pop : {} version = args || [">= 0"] _deprecated_options(options) _normalize_options(name, version, options) dep = Dependency.new(name, version, options) # if there's already a dependency with this name we try to prefer one if current = @dependencies.find { |d| d.name == dep.name } if current.requirement != dep.requirement if current.type == :development @dependencies.delete current elsif dep.type == :development return else raise DslError, "You cannot specify the same gem twice with different version requirements. " \ "You specified: #{current.name} (#{current.requirement}) and " \ "#{dep.name} (#{dep.requirement})" end end if current.source != dep.source if current.type == :development @dependencies.delete current elsif dep.type == :development return else raise DslError, "You cannot specify the same gem twice coming from different sources. You " \ "specified that #{dep.name} (#{dep.requirement}) should come from " \ "#{current.source || 'an unspecfied source'} and #{dep.source}" end end end @dependencies << dep end def source(source, options = {}) case source when :gemcutter, :rubygems, :rubyforge then rubygems_source "http://rubygems.org" return when String rubygems_source source return end @source = source options[:prepend] ? @sources.unshift(@source) : @sources << @source yield if block_given? @source ensure @source = nil end def path(path, options = {}, source_options = {}, &blk) source Source::Path.new(_normalize_hash(options).merge("path" => Pathname.new(path))), source_options, &blk end def git(uri, options = {}, source_options = {}, &blk) unless block_given? msg = "You can no longer specify a git source by itself. Instead, \n" \ "either use the :git option on a gem, or specify the gems that \n" \ "bundler should find in the git source by passing a block to \n" \ "the git method, like: \n\n" \ " git 'git://github.com/rails/rails.git' do\n" \ " gem 'rails'\n" \ " end" raise DeprecatedError, msg end source Source::Git.new(_normalize_hash(options).merge("uri" => uri)), source_options, &blk end def to_definition(lockfile, unlock) @sources << @rubygems_source @sources.uniq! Definition.new(lockfile, @dependencies, @sources, unlock) end def group(*args, &blk) @groups.concat args yield ensure args.each { @groups.pop } end def platforms(*platforms) @platforms.concat platforms yield ensure platforms.each { @platforms.pop } end alias_method :platform, :platforms def env(name) @env, old = name, @env yield ensure @env = old end # Deprecated methods def self.deprecate(name, replacement = nil) define_method(name) do |*| message = "'#{name}' has been removed from the Gemfile DSL, " if replacement message << "and has been replaced with '#{replacement}'." else message << "and is no longer supported." end message << "\nSee the README for more information on upgrading from Bundler 0.8." raise DeprecatedError, message end end deprecate :only, :group deprecate :except deprecate :disable_system_gems deprecate :disable_rubygems deprecate :clear_sources deprecate :bundle_path deprecate :bin_path private def rubygems_source(source) @rubygems_source.add_remote source @sources << @rubygems_source end def _normalize_hash(opts) # Cannot modify a hash during an iteration in 1.9 opts.keys.each do |k| next if String === k v = opts[k] opts.delete(k) opts[k.to_s] = v end opts end def _normalize_options(name, version, opts) _normalize_hash(opts) invalid_keys = opts.keys - %w(group groups git path name branch ref tag require submodules platform platforms type) if invalid_keys.any? plural = invalid_keys.size > 1 message = "You passed #{invalid_keys.map{|k| ':'+k }.join(", ")} " if plural message << "as options for gem '#{name}', but they are invalid." else message << "as an option for gem '#{name}', but it is invalid." end raise InvalidOption, message end groups = @groups.dup opts["group"] = opts.delete("groups") || opts["group"] groups.concat Array(opts.delete("group")) groups = [:default] if groups.empty? platforms = @platforms.dup opts["platforms"] = opts["platform"] || opts["platforms"] platforms.concat Array(opts.delete("platforms")) platforms.map! { |p| p.to_sym } platforms.each do |p| next if VALID_PLATFORMS.include?(p) raise DslError, "`#{p}` is not a valid platform. The available options are: #{VALID_PLATFORMS.inspect}" end # Normalize git and path options ["git", "path"].each do |type| if param = opts[type] if version.first && version.first =~ /^\s*=?\s*(\d[^\s]*)\s*$/ options = opts.merge("name" => name, "version" => $1) else options = opts.dup end source = send(type, param, options, :prepend => true) {} opts["source"] = source end end opts["source"] ||= @source opts["env"] ||= @env opts["platforms"] = platforms.dup opts["group"] = groups end def _deprecated_options(options) if options.include?(:require_as) raise DeprecatedError, "Please replace :require_as with :require" elsif options.include?(:vendored_at) raise DeprecatedError, "Please replace :vendored_at with :path" elsif options.include?(:only) raise DeprecatedError, "Please replace :only with :group" elsif options.include?(:except) raise DeprecatedError, "The :except option is no longer supported" end end end end
neutrico/deb-ruby-bundler
lib/bundler/dsl.rb
Ruby
mit
8,275
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.datalake.analytics.models; import com.fasterxml.jackson.annotation.JsonProperty; /** * Generic resource error details information. */ public class ErrorDetails { /** * the HTTP status code or error code associated with this error. */ @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) private String code; /** * the error message localized based on Accept-Language. */ @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /** * the target of the particular error (for example, the name of the * property in error). */ @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) private String target; /** * Get the code value. * * @return the code value */ public String code() { return this.code; } /** * Get the message value. * * @return the message value */ public String message() { return this.message; } /** * Get the target value. * * @return the target value */ public String target() { return this.target; } }
pomortaz/azure-sdk-for-java
azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/models/ErrorDetails.java
Java
mit
1,470
var path = require('path'); var SEP = path.sep; function relative(include, modulePrefix) { if (include.indexOf('"') == 0) { include = include.slice(1, -1); } if (modulePrefix && include.indexOf(modulePrefix + '/') == 0) { return include; } if (include.indexOf('.') != 0 // 不是./ 或 ../的相对路径 && include.indexOf('/') != 0) { // 不是 / 开头的绝对路径 // 那就认为是相对与当前模块的相对路径 include = './' + include; } return include; } function placeholder(index) { return '__CROX_PLACEHOLDER__' + index + '__CROX_PLACEHOLDER__'; } function getReplaces(includeStrs, modulePrefix) { var mapper = {}; var replaces = []; includeStrs.forEach(function(s) { var include = s.replace(/(\{\{\s*include\s+"\s*)|(\s*\.tpl\s*"\s*\}\}\s*)/g, ''); include = relative(include, modulePrefix); // 避免重复replace if (mapper[include]) { return; } mapper[include] = 1; replaces.push("tmpl = tmpl.replace(RegExp('" + s + "', 'g'), require('" + include + ".tpl').tmpl);") }) replaces = replaces.join(''); return replaces; } exports.relative = relative; exports.placeholder = placeholder; exports.getReplaces = getReplaces;
nighca/crox
bin/helper/utils.js
JavaScript
mit
1,310
package pb import () var ( // Full - preset with all default available elements // Example: 'Prefix 20/100 [-->______] 20% 1 p/s ETA 1m Suffix' Full ProgressBarTemplate = `{{string . "prefix"}}{{counters . }} {{bar . }} {{percent . }} {{speed . }} {{rtime . "ETA %s"}}{{string . "suffix"}}` // Default - preset like Full but without elapsed time // Example: 'Prefix 20/100 [-->______] 20% 1 p/s ETA 1m Suffix' Default ProgressBarTemplate = `{{string . "prefix"}}{{counters . }} {{bar . }} {{percent . }} {{speed . }}{{string . "suffix"}}` // Simple - preset without speed and any timers. Only counters, bar and percents // Example: 'Prefix 20/100 [-->______] 20% Suffix' Simple ProgressBarTemplate = `{{string . "prefix"}}{{counters . }} {{bar . }} {{percent . }}{{string . "suffix"}}` )
tosone/cplusplus
vendor/gopkg.in/cheggaaa/pb.v2/preset.go
GO
mit
801
var expect = require('chai').expect; var Promise = require('pinkie'); var testcafeBrowserTools = require('testcafe-browser-tools'); var browserProviderPool = require('../../lib/browser/provider/pool'); describe('Browser provider', function () { describe('Path and arguments handling', function () { var processedBrowserInfo = null; var originalBrowserToolsGetBrowserInfo = null; var originalBrowserToolsOpen = null; var originalBrowserToolsGetInstallations = null; function getBrowserInfo (arg) { return browserProviderPool .getBrowserInfo(arg) .then(function (browserInfo) { return browserInfo.provider.openBrowser('id', 'test-url', browserInfo.browserName); }) .catch(function (error) { expect(error.message).to.contain('STOP'); return processedBrowserInfo; }); } before(function () { originalBrowserToolsGetBrowserInfo = testcafeBrowserTools.getBrowserInfo; originalBrowserToolsOpen = testcafeBrowserTools.open; originalBrowserToolsGetInstallations = testcafeBrowserTools.getInstallations; testcafeBrowserTools.getBrowserInfo = function (path) { return { path: path, cmd: '--internal-arg' }; }; testcafeBrowserTools.open = function (browserInfo) { processedBrowserInfo = browserInfo; throw new Error('STOP'); }; testcafeBrowserTools.getInstallations = function () { return new Promise(function (resolve) { resolve({ chrome: {} }); }); }; }); after(function () { testcafeBrowserTools.getBrowserInfo = originalBrowserToolsGetBrowserInfo; testcafeBrowserTools.open = originalBrowserToolsOpen; testcafeBrowserTools.getInstallations = originalBrowserToolsGetInstallations; }); it('Should parse browser parameters with arguments', function () { return getBrowserInfo('path:/usr/bin/chrome --arg1 --arg2') .then(function (browserInfo) { expect(browserInfo.path).to.be.equal('/usr/bin/chrome'); expect(browserInfo.cmd).to.be.equal('--internal-arg --arg1 --arg2'); }); }); it('Should parse browser parameters with arguments if there are spaces in a file path', function () { return getBrowserInfo('path:`/opt/Google Chrome/chrome` --arg1 --arg2') .then(function (browserInfo) { expect(browserInfo.path).to.be.equal('/opt/Google Chrome/chrome'); expect(browserInfo.cmd).to.be.equal('--internal-arg --arg1 --arg2'); }); }); it('Should parse alias with arguments', function () { return getBrowserInfo('chrome --arg1 --arg2') .then(function (browserInfo) { expect(browserInfo.path).to.be.equal('chrome'); expect(browserInfo.cmd).to.be.equal('--internal-arg --arg1 --arg2'); }); }); }); describe('Init/dispose error handling', function () { var initShouldSuccess = false; var dummyProvider = { init: function () { if (initShouldSuccess) return Promise.resolve(); return Promise.reject(new Error('Initialization error')); }, dispose: function () { return Promise.reject(new Error('Dispose error')); } }; before(function () { browserProviderPool.addProvider('dummy', dummyProvider); }); after(function () { browserProviderPool.removeProvider('dummy'); }); beforeEach(function () { initShouldSuccess = false; }); it('Should catch initialization error', function () { return browserProviderPool .getProvider('dummy') .then(function () { throw new Error('Promise rejection expected'); }) .catch(function (error) { expect(error.message).to.contain('Initialization error'); }); }); it('Should catch dispose error', function () { initShouldSuccess = true; return browserProviderPool .getProvider('dummy') .then(function () { return browserProviderPool.dispose(); }) .then(function () { throw new Error('Promise rejection expected'); }) .catch(function (error) { expect(error.message).to.contain('Dispose error'); }); }); }); });
georgiy-abbasov/testcafe-phoenix
test/server/browser-provider-test.js
JavaScript
mit
5,151
{% if not paginator %} {% set paginator = get_paginator() %} {% endif %} {% if paginator.has_previous or paginator.has_next %} <div class="clear"></div> <div class="pager"> {% if paginator.has_previous %} <a class="pre" href="{{ paginator.previous_page_url }}">上一页</a> {% else %} <span class="pre unavailable">已是最新一页</span> {% endif %} {% if paginator.has_next %} <a class="next" href="{{ paginator.next_page_url}}">下一页</a> {% else %} <span class="next unavailable">已是最后一页</span> {% endif %} </div> {% endif %}
shuibaco/farbox-theme-ink
template/include/paginator.html
HTML
mit
630
using System; using System.IO; using System.Linq; using Xunit; public class WeaversHistoryTests { [Fact] public void AddNewFile() { var fileName = Path.GetTempFileName(); try { var hasChanged = WeaversHistory.HasChanged(new[] {fileName}); Assert.False(hasChanged); Assert.Equal(fileName, WeaversHistory.TimeStamps.First().Key); } finally { File.Delete(fileName); WeaversHistory.TimeStamps.Clear(); } } [Fact] public void Changed() { var fileName = Path.GetTempFileName(); try { WeaversHistory.HasChanged(new[] {fileName}); File.SetLastWriteTimeUtc(fileName, DateTime.Now.AddHours(1)); var hasChanged = WeaversHistory.HasChanged(new[] {fileName}); Assert.True(hasChanged); } finally { File.Delete(fileName); WeaversHistory.TimeStamps.Clear(); } } [Fact] public void Same() { var fileName = Path.GetTempFileName(); try { WeaversHistory.HasChanged(new[] { fileName }); var hasChanged = WeaversHistory.HasChanged(new[] { fileName }); Assert.False(hasChanged); } finally { File.Delete(fileName); WeaversHistory.TimeStamps.Clear(); } } }
Fody/Fody
Tests/Fody/WeaversHistoryTests.cs
C#
mit
1,443
'use strict'; var utils = require('./utils'); var Pouch = require('./index'); var EE = require('events').EventEmitter; // We create a basic promise so the caller can cancel the replication possibly // before we have actually started listening to changes etc utils.inherits(Replication, EE); function Replication(opts) { EE.call(this); this.cancelled = false; var self = this; var promise = new utils.Promise(function (fulfill, reject) { self.once('complete', fulfill); self.once('error', reject); }); self.then = function (resolve, reject) { return promise.then(resolve, reject); }; self.catch = function (reject) { return promise.catch(reject); }; // As we allow error handling via "error" event as well, // put a stub in here so that rejecting never throws UnhandledError. self.catch(function (err) {}); } Replication.prototype.cancel = function () { this.cancelled = true; this.emit('cancel'); }; Replication.prototype.ready = function (src, target) { var self = this; function onDestroy() { self.cancel(); } src.once('destroyed', onDestroy); target.once('destroyed', onDestroy); function cleanup() { self.removeAllListeners(); src.removeListener('destroyed', onDestroy); target.removeListener('destroyed', onDestroy); } this.then(cleanup, cleanup); }; // TODO: check CouchDB's replication id generation // Generate a unique id particular to this replication function genReplicationId(src, target, opts) { var filterFun = opts.filter ? opts.filter.toString() : ''; return src.id().then(function (src_id) { return target.id().then(function (target_id) { var queryData = src_id + target_id + filterFun + JSON.stringify(opts.query_params) + opts.doc_ids; return '_local/' + utils.MD5(queryData); }); }); } function updateCheckpoint(db, id, checkpoint) { return db.get(id).catch(function (err) { if (err.status === 404) { return {_id: id}; } throw err; }).then(function (doc) { doc.last_seq = checkpoint; return db.put(doc); }); } function Checkpointer(src, target, id) { this.src = src; this.target = target; this.id = id; } Checkpointer.prototype.writeCheckpoint = function (checkpoint) { var self = this; return this.updateTarget(checkpoint).then(function () { return self.updateSource(checkpoint); }); }; Checkpointer.prototype.updateTarget = function (checkpoint) { return updateCheckpoint(this.target, this.id, checkpoint); }; Checkpointer.prototype.updateSource = function (checkpoint) { var self = this; if (this.readOnlySource) { return utils.Promise.resolve(true); } return updateCheckpoint(this.src, this.id, checkpoint).catch(function (err) { if (err.status === 401) { self.readOnlySource = true; return true; } throw err; }); }; Checkpointer.prototype.getCheckpoint = function () { var self = this; return self.target.get(self.id).then(function (targetDoc) { return self.src.get(self.id).then(function (sourceDoc) { if (targetDoc.last_seq === sourceDoc.last_seq) { return sourceDoc.last_seq; } return 0; }, function (err) { if (err.status === 404 && targetDoc.last_seq) { return self.src.put({ _id: self.id, last_seq: 0 }).then(function () { return 0; }, function (err) { if (err.status === 401) { self.readOnlySource = true; return targetDoc.last_seq; } return 0; }); } throw err; }); }).catch(function (err) { if (err.status !== 404) { throw err; } return 0; }); }; function replicate(repId, src, target, opts, returnValue) { var batches = []; // list of batches to be processed var currentBatch; // the batch currently being processed var pendingBatch = { seq: 0, changes: [], docs: [] }; // next batch, not yet ready to be processed var writingCheckpoint = false; // true while checkpoint is being written var changesCompleted = false; // true when all changes received var replicationCompleted = false; // true when replication has completed var last_seq = 0; var continuous = opts.continuous || opts.live || false; var batch_size = opts.batch_size || 100; var batches_limit = opts.batches_limit || 10; var changesPending = false; // true while src.changes is running var changesCount = 0; // number of changes received since calling src.changes var doc_ids = opts.doc_ids; var checkpointer = new Checkpointer(src, target, repId); var result = { ok: true, start_time: new Date(), docs_read: 0, docs_written: 0, doc_write_failures: 0, errors: [] }; var changesOpts = {}; returnValue.ready(src, target); function writeDocs() { if (currentBatch.docs.length === 0) { return; } var docs = currentBatch.docs; return target.bulkDocs({ docs: docs }, { new_edits: false }).then(function (res) { if (returnValue.cancelled) { completeReplication(); throw new Error('cancelled'); } var errors = []; res.forEach(function (res) { if (!res.ok) { result.doc_write_failures++; errors.push(new Error(res.reason || res.message || 'Unknown reason')); } }); if (errors.length > 0) { var error = new Error('bulkDocs error'); error.other_errors = errors; abortReplication('target.bulkDocs failed to write docs', error); throw new Error('bulkWrite partial failure'); } }, function (err) { result.doc_write_failures += docs.length; throw err; }); } function getNextDoc() { var diffs = currentBatch.diffs; var id = Object.keys(diffs)[0]; var revs = diffs[id].missing; return src.get(id, {revs: true, open_revs: revs, attachments: true}) .then(function (docs) { docs.forEach(function (doc) { if (returnValue.cancelled) { return completeReplication(); } if (doc.ok) { result.docs_read++; currentBatch.pendingRevs++; currentBatch.docs.push(doc.ok); delete diffs[doc.ok._id]; } }); }); } function getAllDocs() { if (Object.keys(currentBatch.diffs).length > 0) { return getNextDoc().then(getAllDocs); } else { return utils.Promise.resolve(); } } function getRevisionOneDocs() { // filter out the generation 1 docs and get them // leaving the non-generation one docs to be got otherwise var ids = Object.keys(currentBatch.diffs).filter(function (id) { var missing = currentBatch.diffs[id].missing; return missing.length === 1 && missing[0].slice(0, 2) === '1-'; }); return src.allDocs({ keys: ids, include_docs: true }).then(function (res) { if (returnValue.cancelled) { completeReplication(); throw (new Error('cancelled')); } res.rows.forEach(function (row, i) { if (row.doc && !row.deleted && row.value.rev.slice(0, 2) === '1-' && ( !row.doc._attachments || Object.keys(row.doc._attachments).length === 0 ) ) { result.docs_read++; currentBatch.pendingRevs++; currentBatch.docs.push(row.doc); delete currentBatch.diffs[row.id]; } }); }); } function getDocs() { if (src.type() === 'http') { return getRevisionOneDocs().then(getAllDocs); } else { return getAllDocs(); } } function finishBatch() { writingCheckpoint = true; return checkpointer.writeCheckpoint( currentBatch.seq ).then(function (res) { writingCheckpoint = false; if (returnValue.cancelled) { completeReplication(); throw new Error('cancelled'); } result.last_seq = last_seq = currentBatch.seq; result.docs_written += currentBatch.docs.length; returnValue.emit('change', utils.clone(result)); currentBatch = undefined; getChanges(); }).catch(function (err) { writingCheckpoint = false; abortReplication('writeCheckpoint completed with error', err); throw err; }); } function getDiffs() { var diff = {}; currentBatch.changes.forEach(function (change) { diff[change.id] = change.changes.map(function (x) { return x.rev; }); }); return target.revsDiff(diff).then(function (diffs) { if (returnValue.cancelled) { completeReplication(); throw new Error('cancelled'); } // currentBatch.diffs elements are deleted as the documents are written currentBatch.diffs = diffs; currentBatch.pendingRevs = 0; }); } function startNextBatch() { if (returnValue.cancelled || currentBatch) { return; } if (batches.length === 0) { processPendingBatch(true); return; } currentBatch = batches.shift(); getDiffs() .then(getDocs) .then(writeDocs) .then(finishBatch) .then(startNextBatch) .catch(function (err) { abortReplication('batch processing terminated with error', err); }); } function processPendingBatch(immediate) { if (pendingBatch.changes.length === 0) { if (batches.length === 0 && !currentBatch) { if ((continuous && changesOpts.live) || changesCompleted) { returnValue.emit('uptodate', utils.clone(result)); } if (changesCompleted) { completeReplication(); } } return; } if ( immediate || changesCompleted || pendingBatch.changes.length >= batch_size ) { batches.push(pendingBatch); pendingBatch = { seq: 0, changes: [], docs: [] }; startNextBatch(); } } function abortReplication(reason, err) { if (replicationCompleted) { return; } result.ok = false; result.status = 'aborted'; err.message = reason; result.errors.push(err); batches = []; pendingBatch = { seq: 0, changes: [], docs: [] }; completeReplication(); } function completeReplication() { if (replicationCompleted) { return; } if (returnValue.cancelled) { result.status = 'cancelled'; if (writingCheckpoint) { return; } } result.status = result.status || 'complete'; result.end_time = new Date(); result.last_seq = last_seq; replicationCompleted = returnValue.cancelled = true; if (result.errors.length > 0) { var error = result.errors.pop(); if (result.errors.length > 0) { error.other_errors = result.errors; } error.result = result; returnValue.emit('error', error); } else { returnValue.emit('complete', result); } } function onChange(change) { if (returnValue.cancelled) { return completeReplication(); } changesCount++; if ( pendingBatch.changes.length === 0 && batches.length === 0 && !currentBatch ) { returnValue.emit('outofdate', utils.clone(result)); } pendingBatch.seq = change.seq; pendingBatch.changes.push(change); processPendingBatch(batches.length === 0); } function onChangesComplete(changes) { changesPending = false; if (returnValue.cancelled) { return completeReplication(); } if (changesCount > 0) { changesOpts.since = changes.last_seq; getChanges(); } else { if (continuous) { changesOpts.live = true; getChanges(); } else { changesCompleted = true; } } processPendingBatch(true); } function onChangesError(err) { changesPending = false; if (returnValue.cancelled) { return completeReplication(); } abortReplication('changes rejected', err); } function getChanges() { if ( !changesPending && !changesCompleted && batches.length < batches_limit ) { changesPending = true; changesCount = 0; src.changes(changesOpts) .on('change', onChange) .then(onChangesComplete) .catch(onChangesError); } } function startChanges() { checkpointer.getCheckpoint().then(function (checkpoint) { last_seq = checkpoint; changesOpts = { since: last_seq, limit: batch_size, style: 'all_docs', doc_ids: doc_ids, returnDocs: false }; if (opts.filter) { changesOpts.filter = opts.filter; } if (opts.query_params) { changesOpts.query_params = opts.query_params; } getChanges(); }).catch(function (err) { abortReplication('getCheckpoint rejected with ', err); }); } returnValue.once('cancel', completeReplication); if (typeof opts.onChange === 'function') { returnValue.on('change', opts.onChange); } if (typeof opts.complete === 'function') { returnValue.once('error', opts.complete); returnValue.once('complete', function (result) { opts.complete(null, result); }); } if (typeof opts.since === 'undefined') { startChanges(); } else { writingCheckpoint = true; checkpointer.writeCheckpoint(opts.since).then(function (res) { writingCheckpoint = false; if (returnValue.cancelled) { completeReplication(); return; } last_seq = opts.since; startChanges(); }).catch(function (err) { writingCheckpoint = false; abortReplication('writeCheckpoint completed with error', err); throw err; }); } } function toPouch(db) { if (typeof db === 'string') { return new Pouch(db); } else if (db.then) { return db; } else { return utils.Promise.resolve(db); } } function replicateWrapper(src, target, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } if (typeof opts === 'undefined') { opts = {}; } if (!opts.complete) { opts.complete = callback || function () {}; } opts = utils.clone(opts); opts.continuous = opts.continuous || opts.live; var replicateRet = new Replication(opts); toPouch(src).then(function (src) { return toPouch(target).then(function (target) { if (opts.server) { if (typeof src.replicateOnServer !== 'function') { throw new TypeError( 'Server replication not supported for ' + src.type() + ' adapter' ); } if (src.type() !== target.type()) { throw new TypeError('Server replication' + ' for different adapter types (' + src.type() + ' and ' + target.type() + ') is not supported' ); } src.replicateOnServer(target, opts, replicateRet); } else { return genReplicationId(src, target, opts).then(function (repId) { replicateRet.emit('id', repId); replicate(repId, src, target, opts, replicateRet); }); } }); }).catch(function (err) { replicateRet.emit('error', err); opts.complete(err); }); return replicateRet; } exports.replicate = replicateWrapper;
vijayee/HydraFile
node_modules/pouchdb/lib/replicate.js
JavaScript
mit
15,314
# frozen_string_literal: false require 'test/unit' class TestAlias < Test::Unit::TestCase class Alias0 def foo "foo" end end class Alias1 < Alias0 alias bar foo def foo "foo+#{super}" end end class Alias2 < Alias1 alias baz foo undef foo end class Alias3 < Alias2 def foo super end def bar super end def quux super end end def test_alias x = Alias2.new assert_equal "foo", x.bar assert_equal "foo+foo", x.baz assert_equal "foo+foo", x.baz # test_check for cache x = Alias3.new assert_raise(NoMethodError) { x.foo } assert_equal "foo", x.bar assert_raise(NoMethodError) { x.quux } end class C def m $SAFE end end def test_nonexistmethod assert_raise(NameError){ Class.new{ alias_method :foobarxyzzy, :barbaz } } end def test_send_alias x = "abc" class << x alias_method :try, :__send__ end assert_equal("ABC", x.try(:upcase), '[ruby-dev:38824]') end def test_special_const_alias assert_raise(TypeError) do 1.instance_eval do alias to_string to_s end end end def test_alias_with_zsuper_method c = Class.new c.class_eval do def foo :ok end def bar :ng end private :foo end d = Class.new(c) d.class_eval do public :foo alias bar foo end assert_equal(:ok, d.new.bar) end module SuperInAliasedModuleMethod module M def foo super << :M end alias bar foo end class Base def foo [:Base] end end class Derived < Base include M end end # [ruby-dev:46028] def test_super_in_aliased_module_method # fails in 1.8 assert_equal([:Base, :M], SuperInAliasedModuleMethod::Derived.new.bar) end def test_alias_wb_miss assert_normal_exit %q{ require 'stringio' GC.verify_internal_consistency GC.start class StringIO alias_method :read_nonblock, :sysread end GC.verify_internal_consistency } end def test_cyclic_zsuper bug9475 = '[ruby-core:60431] [Bug #9475]' a = Module.new do def foo "A" end end b = Class.new do include a attr_reader :b def foo @b ||= 0 raise SystemStackError if (@b += 1) > 1 # "foo from B" super + "B" end end c = Class.new(b) do alias orig_foo foo def foo # "foo from C" orig_foo + "C" end end b.class_eval do alias orig_foo foo attr_reader :b2 def foo @b2 ||= 0 raise SystemStackError if (@b2 += 1) > 1 # "foo from B (again)" orig_foo + "B2" end end assert_nothing_raised(SystemStackError, bug9475) do assert_equal("ABC", c.new.foo, bug9475) end end def test_alias_in_module bug9663 = '[ruby-core:61635] [Bug #9663]' assert_separately(['-', bug9663], <<-'end;') bug = ARGV[0] m = Module.new do alias orig_to_s to_s end o = Object.new.extend(m) assert_equal(o.to_s, o.orig_to_s, bug) end; end class C0; def foo; end; end class C1 < C0; alias bar foo; end def test_alias_method_equation obj = C1.new assert_equal(obj.method(:bar), obj.method(:foo)) assert_equal(obj.method(:foo), obj.method(:bar)) end end
rokn/Count_Words_2015
fetched_code/ruby/test_alias.rb
Ruby
mit
3,515
#!/usr/bin/perl # # Copyright (C) 2006, 2007, 2009, 2010, 2012 Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. # $Id$ # updateopenssl.pl # This script locates the latest version of OpenSSL in the grandparent # directory and updates the build scripts to use that version. # # Path and directory $path = "..\\..\\"; # List of files that need to be updated with the actual version of the # openssl directory @filelist = ("SetupLibs.bat", "../lib/dns/win32/libdns.mak", "../lib/dns/win32/libdns.dsp", "../bin/named/win32/named.mak", "../bin/named/win32/named.dsp"); # Locate the openssl directory $substr = getdirectory(); if ($substr eq 0) { print "No directory found\n"; } else { print "Found $substr directory\n"; } #Update the list of files if ($substr ne 0) { $ind = 0; foreach $file (@filelist) { print "Updating file $file\n"; updatefile($file, $substr); $ind++; } } # Function to find the sub getdirectory { my(@namelist); my($file, $name); my($cnt); opendir(DIR,$path) || die "No Directory: $!"; @namelist = grep (/^openssl-[0-9]+\.[0-9]+\.[0-9]+[a-z]{0,1}$/i, readdir(DIR)); closedir(DIR); # Make sure we have something if (scalar(@namelist) == 0) { return (0); } # Now see if we have a directory or just a file. # Make sure we are case insensitive foreach $file (sort {uc($a) cmp uc($b)} @namelist) { if (-d $path.$file) { $name = $file; } } # If we have one use it otherwise report the error # Note that we are only interested in the last one # since the sort should have taken care of getting # the latest if (defined($name)) { return ($name); } else { return (0); } } # function to replace the openssl directory name with the latest one sub updatefile { my($filename, $substr, $line); my(@Lines); $filename = $_[0]; $substr = $_[1]; open (RFILE, $filename) || die "Can't open file $filename: $!"; @Lines = <RFILE>; close (RFILE); # Replace the string foreach $line (@Lines) { $line =~ s/openssl-[0-9]+\.[0-9]+\.[0-9]+[a-z]{0,1}/$substr/gi; } #update the file open (RFILE, ">$filename") || die "Can't open file $filename: $!"; foreach $line (@Lines) { print RFILE $line; } close(RFILE); }
juneman/server-perf
win32utils/updateopenssl.pl
Perl
mit
3,160
package com.geth1b.coding.skills.lc; import com.geth1b.coding.ds.NestedInteger; import java.util.ArrayDeque; import java.util.Deque; import java.util.Iterator; /** * [Reference URL]: https://leetcode.com/problems/mini-parser/ * [Algorithm]: Stack + String ops * [Data Structure]: Stack * [Time BigO]: O(n) * [Space BigO]: O(n) * * @author geth1b */ public class _385_MiniParser { // DFS - count left parenthesis to get one [...] segement; this is key // O(n) time // O(n) space public NestedInteger deserialize(String s) { if (s.charAt(0) != '[') { // single num return new NestedInteger(Integer.valueOf(s)); // base case } // else, it's a list NestedInteger list = new NestedInteger(); int n = s.length(); Scanner scanner = new Scanner(s.substring(1, n - 1)); // *** key step; exclude [] for (String token : scanner) { list.add(deserialize(token)); // dfs call here } return list; } private class Scanner implements Iterable<String> { private final String s; private final int n; private int index; private Scanner(String s) { this.s = s; n = s.length(); index = 0; } @Override public Iterator<String> iterator() { return new Iterator<String>() { @Override public boolean hasNext() { if (index < n && s.charAt(index) == ',') { index++; // skip comma } return index < n; } @Override public String next() { if (s.charAt(index) != '[') { // simple num int i = index + 1; while (i < n && s.charAt(i) != ',') { i++; // do it manually; could be just one num without comma } String val = s.substring(index, i); index = i; return val; } // else; it's segment enclosed by [...] int L = 1; // count of left parentheses; init to 1 for starting '[' int i = index + 1; while (L != 0) { char c = s.charAt(i); // i must be valid here as input is valid if (c == '[') { L++; } else if (c == ']') { L--; } i++; } String val = s.substring(index, i); // i is exclusive here; must be comma index = i; return val; } }; } } // Use stack to process each inner list and then push it back // This is very similar to parentheses matching & simple calculator // // O(n) time // O(n) space - for the stack public NestedInteger deserialize_stack(String s) { Scanner2 scanner = new Scanner2(s); // custom class below Deque<NestedInteger> stack = new ArrayDeque<>(); NestedInteger LEFT_PARENTHESIS = new NestedInteger(); // special value to mark start of list for (String token : scanner) { if (token.equals("[")) { stack.push(LEFT_PARENTHESIS); } else if (token.equals("]")) { Deque<NestedInteger> buffer = new ArrayDeque<>(); // a stack to reverse order while (stack.peek() != LEFT_PARENTHESIS) { buffer.push(stack.pop()); } stack.pop(); // remove '[' NestedInteger newList = new NestedInteger(); for (NestedInteger x : buffer) { newList.add(x); } stack.push(newList); } else { NestedInteger newInteger = new NestedInteger(Integer.valueOf(token)); stack.push(newInteger); } } return stack.pop(); } private class Scanner2 implements Iterable<String> { private final String s; private final int n; private int index; private Scanner2(String s) { this.s = s; n = s.length(); index = 0; } @Override public Iterator<String> iterator() { return new Iterator<String>() { @Override public boolean hasNext() { if (index < n && s.charAt(index) == ',') { index++; // skip comma } return index < n; } @Override public String next() { char c = s.charAt(index); if (c == '[' || c == ']') { index++; return String.valueOf(c); } // else; must be num int i = index + 1; while (i < n && Character.isDigit(s.charAt(i))) { i++; } String val = s.substring(index, i); index = i; // jump to next pos; i is exclusive return val; } }; } } }
geth1b/h1b-coding-interview
src/main/java/com/geth1b/coding/skills/lc/_385_MiniParser.java
Java
mit
4,589
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/base/shared_base_jumpsuit.iff" result.attribute_template_id = 11 result.stfName("wearables_name","bodysuit_s01") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
anhstudios/swganh
data/scripts/templates/object/tangible/wearables/base/shared_base_jumpsuit.py
Python
mit
459
const { document } = require('global'); exports.onRouteUpdate = location => { if (location.hash) { setTimeout(() => { document.querySelector(`${location.hash}`).scrollIntoView(); }, 0); } };
rhalff/storybook
docs/gatsby-browser.js
JavaScript
mit
210
/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the assimp team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of the assimp team. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ /** @file STEPFileReader.cpp * @brief Implementation of the STEP file parser, which fills a * STEP::DB with data read from a file. */ #include "STEPFileReader.h" #include "STEPFileEncoding.h" #include <assimp/TinyFormatter.h> #include <assimp/fast_atof.h> #include <memory> using namespace Assimp; namespace EXPRESS = STEP::EXPRESS; #include <functional> // ------------------------------------------------------------------------------------------------ std::string AddLineNumber(const std::string& s,uint64_t line /*= LINE_NOT_SPECIFIED*/, const std::string& prefix = "") { return line == STEP::SyntaxError::LINE_NOT_SPECIFIED ? prefix+s : static_cast<std::string>( (Formatter::format(),prefix,"(line ",line,") ",s) ); } // ------------------------------------------------------------------------------------------------ std::string AddEntityID(const std::string& s,uint64_t entity /*= ENTITY_NOT_SPECIFIED*/, const std::string& prefix = "") { return entity == STEP::TypeError::ENTITY_NOT_SPECIFIED ? prefix+s : static_cast<std::string>( (Formatter::format(),prefix,"(entity #",entity,") ",s)); } // ------------------------------------------------------------------------------------------------ STEP::SyntaxError::SyntaxError (const std::string& s,uint64_t line /* = LINE_NOT_SPECIFIED */) : DeadlyImportError(AddLineNumber(s,line)) { } // ------------------------------------------------------------------------------------------------ STEP::TypeError::TypeError (const std::string& s,uint64_t entity /* = ENTITY_NOT_SPECIFIED */,uint64_t line /*= LINE_NOT_SPECIFIED*/) : DeadlyImportError(AddLineNumber(AddEntityID(s,entity),line)) { } static const char *ISO_Token = "ISO-10303-21;"; static const char *FILE_SCHEMA_Token = "FILE_SCHEMA"; // ------------------------------------------------------------------------------------------------ STEP::DB* STEP::ReadFileHeader(std::shared_ptr<IOStream> stream) { std::shared_ptr<StreamReaderLE> reader = std::shared_ptr<StreamReaderLE>(new StreamReaderLE(stream)); std::unique_ptr<STEP::DB> db = std::unique_ptr<STEP::DB>(new STEP::DB(reader)); LineSplitter &splitter = db->GetSplitter(); if (!splitter || *splitter != ISO_Token ) { throw STEP::SyntaxError("expected magic token: " + std::string( ISO_Token ), 1); } HeaderInfo& head = db->GetHeader(); for(++splitter; splitter; ++splitter) { const std::string& s = *splitter; if (s == "DATA;") { // here we go, header done, start of data section ++splitter; break; } // want one-based line numbers for human readers, so +1 const uint64_t line = splitter.get_index()+1; if (s.substr(0,11) == FILE_SCHEMA_Token) { const char* sz = s.c_str()+11; SkipSpaces(sz,&sz); std::shared_ptr< const EXPRESS::DataType > schema = EXPRESS::DataType::Parse(sz); // the file schema should be a regular list entity, although it usually contains exactly one entry // since the list itself is contained in a regular parameter list, we actually have // two nested lists. const EXPRESS::LIST* list = dynamic_cast<const EXPRESS::LIST*>(schema.get()); if (list && list->GetSize()) { list = dynamic_cast<const EXPRESS::LIST*>( (*list)[0].get() ); if (!list) { throw STEP::SyntaxError("expected FILE_SCHEMA to be a list",line); } // XXX need support for multiple schemas? if (list->GetSize() > 1) { ASSIMP_LOG_WARN(AddLineNumber("multiple schemas currently not supported",line)); } const EXPRESS::STRING* string( nullptr ); if (!list->GetSize() || !(string=dynamic_cast<const EXPRESS::STRING*>( (*list)[0].get() ))) { throw STEP::SyntaxError("expected FILE_SCHEMA to contain a single string literal",line); } head.fileSchema = *string; } } // XXX handle more header fields } return db.release(); } namespace { // ------------------------------------------------------------------------------------------------ // check whether the given line contains an entity definition (i.e. starts with "#<number>=") bool IsEntityDef(const std::string& snext) { if (snext[0] == '#') { // it is only a new entity if it has a '=' after the // entity ID. for(std::string::const_iterator it = snext.begin()+1; it != snext.end(); ++it) { if (*it == '=') { return true; } if ((*it < '0' || *it > '9') && *it != ' ') { break; } } } return false; } } // ------------------------------------------------------------------------------------------------ void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, const char* const* types_to_track, size_t len, const char* const* inverse_indices_to_track, size_t len2) { db.SetSchema(scheme); db.SetTypesToTrack(types_to_track,len); db.SetInverseIndicesToTrack(inverse_indices_to_track,len2); const DB::ObjectMap& map = db.GetObjects(); LineSplitter& splitter = db.GetSplitter(); while (splitter) { bool has_next = false; std::string s = *splitter; if (s == "ENDSEC;") { break; } s.erase(std::remove(s.begin(), s.end(), ' '), s.end()); // want one-based line numbers for human readers, so +1 const uint64_t line = splitter.get_index()+1; // LineSplitter already ignores empty lines ai_assert(s.length()); if (s[0] != '#') { ASSIMP_LOG_WARN(AddLineNumber("expected token \'#\'",line)); ++splitter; continue; } // --- // extract id, entity class name and argument string, // but don't create the actual object yet. // --- const std::string::size_type n0 = s.find_first_of('='); if (n0 == std::string::npos) { ASSIMP_LOG_WARN(AddLineNumber("expected token \'=\'",line)); ++splitter; continue; } const uint64_t id = strtoul10_64(s.substr(1,n0-1).c_str()); if (!id) { ASSIMP_LOG_WARN(AddLineNumber("expected positive, numeric entity id",line)); ++splitter; continue; } std::string::size_type n1 = s.find_first_of('(',n0); if (n1 == std::string::npos) { has_next = true; bool ok = false; for( ++splitter; splitter; ++splitter) { const std::string& snext = *splitter; if (snext.empty()) { continue; } // the next line doesn't start an entity, so maybe it is // just a continuation for this line, keep going if (!IsEntityDef(snext)) { s.append(snext); n1 = s.find_first_of('(',n0); ok = (n1 != std::string::npos); } else { break; } } if(!ok) { ASSIMP_LOG_WARN(AddLineNumber("expected token \'(\'",line)); continue; } } std::string::size_type n2 = s.find_last_of(')'); if (n2 == std::string::npos || n2 < n1 || n2 == s.length() - 1 || s[n2 + 1] != ';') { has_next = true; bool ok = false; for( ++splitter; splitter; ++splitter) { const std::string& snext = *splitter; if (snext.empty()) { continue; } // the next line doesn't start an entity, so maybe it is // just a continuation for this line, keep going if (!IsEntityDef(snext)) { s.append(snext); n2 = s.find_last_of(')'); ok = !(n2 == std::string::npos || n2 < n1 || n2 == s.length() - 1 || s[n2 + 1] != ';'); } else { break; } } if(!ok) { ASSIMP_LOG_WARN(AddLineNumber("expected token \')\'",line)); continue; } } if (map.find(id) != map.end()) { ASSIMP_LOG_WARN(AddLineNumber((Formatter::format(),"an object with the id #",id," already exists"),line)); } std::string::size_type ns = n0; do ++ns; while( IsSpace(s.at(ns))); std::string::size_type ne = n1; do --ne; while( IsSpace(s.at(ne))); std::string type = s.substr(ns,ne-ns+1); std::transform( type.begin(), type.end(), type.begin(), &Assimp::ToLower<char> ); const char* sz = scheme.GetStaticStringForToken(type); if(sz) { const std::string::size_type szLen = n2-n1+1; char* const copysz = new char[szLen+1]; std::copy(s.c_str()+n1,s.c_str()+n2+1,copysz); copysz[szLen] = '\0'; db.InternInsert(new LazyObject(db,id,line,sz,copysz)); } if(!has_next) { ++splitter; } } if (!splitter) { ASSIMP_LOG_WARN("STEP: ignoring unexpected EOF"); } if ( !DefaultLogger::isNullLogger()){ ASSIMP_LOG_DEBUG((Formatter::format(),"STEP: got ",map.size()," object records with ", db.GetRefs().size()," inverse index entries")); } } // ------------------------------------------------------------------------------------------------ std::shared_ptr<const EXPRESS::DataType> EXPRESS::DataType::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/) { const char* cur = inout; SkipSpaces(&cur); if (*cur == ',' || IsSpaceOrNewLine(*cur)) { throw STEP::SyntaxError("unexpected token, expected parameter",line); } // just skip over constructions such as IFCPLANEANGLEMEASURE(0.01) and read only the value if (schema) { bool ok = false; for(const char* t = cur; *t && *t != ')' && *t != ','; ++t) { if (*t=='(') { if (!ok) { break; } for(--t;IsSpace(*t);--t); std::string s(cur,static_cast<size_t>(t-cur+1)); std::transform(s.begin(),s.end(),s.begin(),&ToLower<char> ); if (schema->IsKnownToken(s)) { for(cur = t+1;*cur++ != '(';); const std::shared_ptr<const EXPRESS::DataType> dt = Parse(cur); inout = *cur ? cur+1 : cur; return dt; } break; } else if (!IsSpace(*t)) { ok = true; } } } if (*cur == '*' ) { inout = cur+1; return std::make_shared<EXPRESS::ISDERIVED>(); } else if (*cur == '$' ) { inout = cur+1; return std::make_shared<EXPRESS::UNSET>(); } else if (*cur == '(' ) { // start of an aggregate, further parsing is done by the LIST factory constructor inout = cur; return EXPRESS::LIST::Parse(inout,line,schema); } else if (*cur == '.' ) { // enum (includes boolean) const char* start = ++cur; for(;*cur != '.';++cur) { if (*cur == '\0') { throw STEP::SyntaxError("enum not closed",line); } } inout = cur+1; return std::make_shared<EXPRESS::ENUMERATION>(std::string(start, static_cast<size_t>(cur-start) )); } else if (*cur == '#' ) { // object reference return std::make_shared<EXPRESS::ENTITY>(strtoul10_64(++cur,&inout)); } else if (*cur == '\'' ) { // string literal const char* start = ++cur; for(;*cur != '\'';++cur) { if (*cur == '\0') { throw STEP::SyntaxError("string literal not closed",line); } } if (cur[1] == '\'') { // Vesanen: more than 2 escaped ' in one literal! do { for(cur += 2;*cur != '\'';++cur) { if (*cur == '\0') { throw STEP::SyntaxError("string literal not closed",line); } } } while(cur[1] == '\''); } inout = cur + 1; // assimp is supposed to output UTF8 strings, so we have to deal // with foreign encodings. std::string stemp = std::string(start, static_cast<size_t>(cur - start)); if(!StringToUTF8(stemp)) { // TODO: route this to a correct logger with line numbers etc., better error messages ASSIMP_LOG_ERROR("an error occurred reading escape sequences in ASCII text"); } return std::make_shared<EXPRESS::STRING>(stemp); } else if (*cur == '\"' ) { throw STEP::SyntaxError("binary data not supported yet",line); } // else -- must be a number. if there is a decimal dot in it, // parse it as real value, otherwise as integer. const char* start = cur; for(;*cur && *cur != ',' && *cur != ')' && !IsSpace(*cur);++cur) { if (*cur == '.') { double f; inout = fast_atoreal_move<double>(start,f); return std::make_shared<EXPRESS::REAL>(f); } } bool neg = false; if (*start == '-') { neg = true; ++start; } else if (*start == '+') { ++start; } int64_t num = static_cast<int64_t>( strtoul10_64(start,&inout) ); return std::make_shared<EXPRESS::INTEGER>(neg?-num:num); } // ------------------------------------------------------------------------------------------------ std::shared_ptr<const EXPRESS::LIST> EXPRESS::LIST::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/) { const std::shared_ptr<EXPRESS::LIST> list = std::make_shared<EXPRESS::LIST>(); EXPRESS::LIST::MemberList& members = list->members; const char* cur = inout; if (*cur++ != '(') { throw STEP::SyntaxError("unexpected token, expected \'(\' token at beginning of list",line); } // estimate the number of items upfront - lists can grow large size_t count = 1; for(const char* c=cur; *c && *c != ')'; ++c) { count += (*c == ',' ? 1 : 0); } members.reserve(count); for(;;++cur) { if (!*cur) { throw STEP::SyntaxError("unexpected end of line while reading list"); } SkipSpaces(cur,&cur); if (*cur == ')') { break; } members.push_back( EXPRESS::DataType::Parse(cur,line,schema)); SkipSpaces(cur,&cur); if (*cur != ',') { if (*cur == ')') { break; } throw STEP::SyntaxError("unexpected token, expected \',\' or \')\' token after list element",line); } } inout = cur+1; return list; } // ------------------------------------------------------------------------------------------------ static void handleSkippedDepthFromToken(const char *a, int64_t &skip_depth ) { if (*a == '(') { ++skip_depth; } else if (*a == ')') { --skip_depth; } } // ------------------------------------------------------------------------------------------------ static int64_t getIdFromToken(const char *a) { const char *tmp; const int64_t num = static_cast<int64_t>(strtoul10_64(a + 1, &tmp)); return num; } // ------------------------------------------------------------------------------------------------ STEP::LazyObject::LazyObject(DB& db, uint64_t id,uint64_t /*line*/, const char* const type,const char* args) : id(id) , type(type) , db(db) , args(args) , obj() { // find any external references and store them in the database. // this helps us emulate STEPs INVERSE fields. if (!db.KeepInverseIndicesForType(type)) { return; } // do a quick scan through the argument tuple and watch out for entity references const char *a( args ); int64_t skip_depth( 0 ); while ( *a ) { handleSkippedDepthFromToken(a, skip_depth); /*if (*a == '(') { ++skip_depth; } else if (*a == ')') { --skip_depth; }*/ if (skip_depth >= 1 && *a=='#') { if (*(a + 1) != '#') { /*const char *tmp; const int64_t num = static_cast<int64_t>(strtoul10_64(a + 1, &tmp)); db.MarkRef(num, id);*/ db.MarkRef(getIdFromToken(a), id); } else { ++a; } } ++a; } } // ------------------------------------------------------------------------------------------------ STEP::LazyObject::~LazyObject() { // make sure the right dtor/operator delete get called if (obj) { delete obj; } else { delete[] args; } } // ------------------------------------------------------------------------------------------------ void STEP::LazyObject::LazyInit() const { const EXPRESS::ConversionSchema& schema = db.GetSchema(); STEP::ConvertObjectProc proc = schema.GetConverterProc(type); if (!proc) { throw STEP::TypeError("unknown object type: " + std::string(type),id); } const char* acopy = args; std::shared_ptr<const EXPRESS::LIST> conv_args = EXPRESS::LIST::Parse(acopy,STEP::SyntaxError::LINE_NOT_SPECIFIED,&db.GetSchema()); delete[] args; args = NULL; // if the converter fails, it should throw an exception, but it should never return NULL try { obj = proc(db,*conv_args); } catch(const TypeError& t) { // augment line and entity information throw TypeError(t.what(),id); } ++db.evaluated_count; ai_assert(obj); // store the original id in the object instance obj->SetID(id); }
Bloodknight/Torque3D
Engine/lib/assimp/code/Importer/STEPParser/STEPFileReader.cpp
C++
mit
19,840
// Copyright (c) DotSpatial Team. All rights reserved. // Licensed under the MIT license. See License.txt file in the project root for full license information. using System.Collections.Generic; using System.Drawing; using DotSpatial.Data; using NetTopologySuite.Geometries; namespace DotSpatial.Compatibility { /// <summary> /// Layer. /// </summary> public interface ILayerOld { #region Properties /// <summary> /// Gets or sets the color of this shapefile. Applies only to shapefiles. Setting the color of the /// shapefile will clear any selected shapes and will also reset each individual shape to the same color. /// The coloring scheme will also be overriden. /// </summary> Color Color { get; set; } /// <summary> /// Gets or sets the coloring scheme. The <c>Shapefile</c> and <c>Grid</c> objects each have /// their own coloring scheme object. It is important to cast the <c>ColoringScheme</c> to the /// proper type. /// </summary> object ColoringScheme { get; set; } /// <summary> /// Gets or sets a value indicating whether or not to draw the fill for a polygon shapefile. /// </summary> bool DrawFill { get; set; } /// <summary> /// Gets or sets the extents where the layer changes from visible to not visible or vice versa. /// If the map is zoomed beyond these extents, the layer is invisible until the map is zoomed to /// be within these extents. /// </summary> Envelope DynamicVisibilityExtents { get; set; } /// <summary> /// Gets or sets a value indicating whether the layer's coloring scheme is expanded in the legend. /// </summary> bool Expanded { get; set; } /// <summary> /// Gets the extents of this layer. /// </summary> Envelope Extents { get; } /// <summary> /// Gets the fileName of this layer. If the layer is memory-based only it may not have a valid fileName. /// </summary> string FileName { get; } /// <summary> /// Gets or sets the stipple pattern to use for the entire shapefile. /// /// The valid values for this property are: /// <list type="bullet"> /// <item>Custom</item> /// <item>DashDotDash</item> /// <item>Dashed</item> /// <item>Dotted</item> /// <item>None</item> /// </list> /// </summary> Stipple FillStipple { get; set; } /// <summary> /// Gets the <c>MapWinGIS.Grid</c> object associated with the layer. If the layer is not a /// grid layer, "Nothing" will be returned. /// </summary> IRaster GetGridObject { get; } /// <summary> /// Gets or sets the position of the layer without respect to any group. /// </summary> int GlobalPosition { get; set; } /// <summary> /// Gets or sets the handle of the group that this layer belongs to. /// </summary> int GroupHandle { get; set; } /// <summary> /// Gets or sets the position of the layer within a group. /// </summary> int GroupPosition { get; set; } /// <summary> /// Gets or sets the layer handle of this layer. The DotSpatial automatically sets the <c>LayerHandle</c> for the layer, and it cannot be reset. /// </summary> int Handle { get; set; } /// <summary> /// Gets or sets a value indicating whether to skip over the layer when drawing the legend. /// </summary> bool HideFromLegend { get; set; } /// <summary> /// Gets or sets the icon to use in the legend for this layer. /// </summary> Image Icon { get; set; } /// <summary> /// Gets or sets the color that represents transparent in an <c>Image</c> layer. /// </summary> Color ImageTransparentColor { get; set; } /// The following label properties were added for plug-in 3.1 version compatibility /// <summary> /// Gets or sets the distance from the label point to the text for the label in pixels. /// </summary> int LabelsOffset { get; set; } /// <summary> /// Gets or sets a value indicating whether labels are scaled for this layer. /// </summary> bool LabelsScale { get; set; } /// <summary> /// Gets or sets a value indicating whether labels are shadowed for this layer. /// </summary> bool LabelsShadow { get; set; } /// <summary> /// Gets or sets the color of the labels shadows. /// </summary> Color LabelsShadowColor { get; set; } /// <summary> /// Gets or sets a value indicating whether labels for this layer should be visible. /// </summary> bool LabelsVisible { get; set; } /// <summary> /// Gets the type of this layer. Valid values are: /// <list type="bullet"> /// <item>Grid</item> /// <item>Image</item> /// <item>Invalid</item> /// <item>LineShapefile</item> /// <item>PointShapefile</item> /// <item>PolygonShapefile</item> /// </list> /// </summary> LayerType LayerType { get; } /// <summary> /// Gets or sets the line or point size. If the <c>PointType</c> is <c>ptUserDefined</c> then the /// size of the user defined point will be multiplied by the <c>LineOrPointSize</c>. For all other /// points and for lines, the <c>LineOrPointSize</c> is represented in pixels. /// </summary> float LineOrPointSize { get; set; } /// <summary> /// Gets or sets the width between lines for multiple-line drawing styles (e.g, doublesolid). /// </summary> int LineSeparationFactor { get; set; } /// <summary> /// Gets or sets the stipple pattern to use for the entire shapefile. /// The valid values for this property are: /// <list type="bullet"> /// <item>Custom</item> /// <item>DashDotDash</item> /// <item>Dashed</item> /// <item>Dotted</item> /// <item>None</item> /// </list> /// </summary> Stipple LineStipple { get; set; } /// <summary> /// Gets or sets the layer name. /// </summary> string Name { get; set; } /// <summary> /// Gets or sets the outline color for this layer. Only applies to polygon shapefile layers. /// </summary> Color OutlineColor { get; set; } /// <summary> /// Gets or sets the Point Image Scheme object for a given point layer. To be used from DotSpatial only. /// </summary> object PointImageScheme { get; set; } /// <summary> /// Gets or sets the point type for this shapefile. /// The valid values for this property are: /// <list type="bullet"> /// <item>ptCircle</item> /// <item>ptDiamond</item> /// <item>ptSquare</item> /// <item>ptTriangleDown</item> /// <item>ptTriangleLeft</item> /// <item>ptTriangleRight</item> /// <item>ptTriangleUp</item> /// <item>ptUserDefined</item> /// </list> /// </summary> PointType PointType { get; set; } /// <summary> /// Gets or sets the projection of this layer. /// Projections must be / will be in PROJ4 format. /// If no projection is present, "" will be returned. /// If an invalid projection is provided, it's not guaranteed to be saved!. /// </summary> string Projection { get; set; } /// <summary> /// Gets access to all shapes in the layer. Only applies to shapefile layers. /// </summary> List<IFeature> Shapes { get; } /// <summary> /// Gets or sets a value indicating whether to skip over the layer when saving a project. /// </summary> bool SkipOverDuringSave { get; set; } /// <summary> /// Gets or sets the tag for this layer. The tag is simply a string that can be used by the /// programmer to store any information desired. /// </summary> string Tag { get; set; } /// <summary> /// Gets or sets a value indicating whether or not to use <c>DynamicVisibility</c>. /// </summary> bool UseDynamicVisibility { get; set; } /// <summary> /// Gets or sets a value indicating whether mapWinGIS ocx will hide labels which collide with already drawn labels or not. /// </summary> bool UseLabelCollision { get; set; } /// <summary> /// Gets or sets the user defined line stipple. A line stipple is simply a 32-bit integer /// whose bits define a pattern that can be displayed on the screen. For example, the value /// 0011 0011 in binary would represent a dashed line ( -- --). /// </summary> int UserLineStipple { get; set; } /// <summary> /// Gets or sets the user defined point image for this layer. To display the user defined point /// the layer's <c>PointType</c> must be set to <c>ptUserDefined</c>. /// </summary> Image UserPointType { get; set; } /// <summary> /// Gets or sets a value indicating whether to use transparency on an <c>Image</c> layer. /// </summary> bool UseTransparentColor { get; set; } /// <summary> /// Gets or sets a value indicating whether the vertices of a line or polygon are visible. This doesn't apply to line shapefiles. /// </summary> bool VerticesVisible { get; set; } /// <summary> /// Gets or sets a value indicating whether the layer is visible. /// </summary> bool Visible { get; set; } #endregion #region Methods /// <summary> /// Adds a label to this layer. /// </summary> /// <param name="text">The text of the label.</param> /// <param name="textColor">The color of the label text.</param> /// <param name="xPos">X position in projected map units.</param> /// <param name="yPos">Y position in projected map units.</param> /// <param name="justification">Text justification. Can be hjCenter, hjLeft or hjRight.</param> void AddLabel(string text, Color textColor, double xPos, double yPos, HJustification justification); /// <summary> /// Adds an extended label to this layer. /// </summary> /// <param name="text">The text of the label.</param> /// <param name="textColor">The color of the label text.</param> /// <param name="xPos">X position in projected map units.</param> /// <param name="yPos">Y position in projected map units.</param> /// <param name="justification">Text justification. Can be hjCenter, hjLeft or hjRight.</param> /// <param name="rotation">The rotation angle for the label.</param> void AddLabelEx(string text, Color textColor, double xPos, double yPos, HJustification justification, double rotation); /// <summary> /// Clears all labels for this layer. /// </summary> void ClearLabels(); /// <summary> /// Clears out the list of images to be used by the tkImageList point type. /// See also UserPointImageListAdd, UserPointImageListItem, UserPointImageListCount, /// and (on the shape interface) ShapePointImageListID. /// </summary> // ReSharper disable once InconsistentNaming void ClearUDPointImageList(); /// <summary> /// Sets the font to use for all labels on this layer. /// </summary> /// <param name="fontName">Name of the font or font family. Example: "Arial".</param> /// <param name="fontSize">Size of the font.</param> void Font(string fontName, int fontSize); /// <summary> /// Gets the underlying MapWinGIS object for this layer. The object can be either a /// <c>MapWinGIS.Shapefile</c> or a <c>MapWinGIS.Image</c>. If the layer is a grid layer the /// <c>MapWinGIS.Grid</c> object can be retrieved using the <c>GetGridObject</c> method. /// </summary> /// <returns>The underlying object as IDataset.</returns> IDataSet GetObject(); /// <summary> /// Gets a single row in the user defined line stipple. There are 32 rows in a fill stipple /// (0-31). Each row is defined the same way as a <c>UserLineStipple</c>. /// </summary> /// <param name="row">The index of the row to get. Must be between 0 and 31 inclusive.</param> /// <returns>A single stipple row.</returns> int GetUserFillStipple(int row); /// <summary> /// Hides all vertices in the shapefile. Only applies to line and polygon shapefiles. /// </summary> void HideVertices(); /// <summary> /// Loads the shapefile rendering properties from a .mwsr file whose base fileName matches the shapefile. /// If the file isn't found, false is returned. /// Function call is ignored and returns false if the layer is a grid. /// </summary> /// <returns>If the file isn't found, false is returned. /// Function call is ignored and returns false if the layer is a grid.</returns> bool LoadShapeLayerProps(); /// <summary> /// Loads the shapefile rendering properties from the specified fileName. /// Function call is ignored and returns false if the layer is a grid. /// </summary> /// <param name="loadFromFilename">File from which the properties get loaded.</param> /// <returns>Returns false if the layer is a grid.</returns> bool LoadShapeLayerProps(string loadFromFilename); /// <summary> /// Moves this layer to a new position in the layer list. The highest position is the topmost layer /// in the display. /// </summary> /// <param name="newPosition">The new position.</param> /// <param name="targetGroup">The group to put this layer in.</param> void MoveTo(int newPosition, int targetGroup); /// <summary> /// Saves the shapefile rendering properties to a .mwsr file whose base fileName matches the shapefile. /// Function call is ignored and returns false if the layer is a grid. /// </summary> /// <returns>False if the layer is a grid.</returns> bool SaveShapeLayerProps(); /// <summary> /// Saves the shapefile rendering properties to the specified fileName. /// Function call is ignored if the layer is a grid. /// </summary> /// <param name="saveToFilename">Name of the file to which the properties should be saved.</param> /// <returns>False, if the layer is a grid.</returns> bool SaveShapeLayerProps(string saveToFilename); /// <summary> /// Sets a single row in the user defined line stipple. There are 32 rows in a fill stipple /// (0-31). Each row is defined the same way as a <c>UserLineStipple</c>. /// </summary> /// <param name="row">The index of the row to set. Must be between 0 and 31 inclusive.</param> /// <param name="value">The row value to set in the fill stipple.</param> void SetUserFillStipple(int row, int value); /// <summary> /// Shows all vertices for the entire shapefile. Applies only to line and polygon shapefiles. /// </summary> /// <param name="color">The color to draw vertices with.</param> /// <param name="vertexSize">The size of each vertex.</param> void ShowVertices(Color color, int vertexSize); /// <summary> /// Returns information about the given layer in a human-readible string. /// </summary> /// <returns>Information about the given layer.</returns> string ToString(); /// <summary> /// Updates the label information file stored for this layer. /// </summary> void UpdateLabelInfo(); /// <summary> /// Adds an image to the list of point images used by the tkImageList point type. /// See also UserPointImageListItem, UserPointImageListCount, ClearUDPointImageList, /// and (on the shape interface) ShapePointImageListID. /// </summary> /// <param name="newValue">The new image to add.</param> /// <returns>The index for this image, to be passed to ShapePointImageListID or other functions.</returns> long UserPointImageListAdd(Image newValue); /// <summary> /// Gets the count of images from the list of images to be used by the tkImageList point type. /// See also UserPointImageListAdd, UserPointImageListItem, ClearUDPointImageList, /// and (on the shape interface) ShapePointImageListID. /// </summary> /// <returns>The count of items in the image list.</returns> long UserPointImageListCount(); /// <summary> /// Gets an image from the list of images to be used by the tkImageList point type. /// See also UserPointImageListAdd, UserPointImageListCount, ClearUDPointImageList, /// and (on the shape interface) ShapePointImageListID. /// </summary> /// <param name="imageIndex">The image index to retrieve.</param> /// <returns>The index associated with this index; or null/nothing if nonexistant.</returns> Image UserPointImageListItem(long imageIndex); /// <summary> /// Zooms the display to this layer, taking into acount the <c>View.ExtentPad</c>. /// </summary> void ZoomTo(); #endregion } }
pergerch/DotSpatial
Source/DotSpatial.Compatibility/ILayerOld.cs
C#
mit
18,520
// // HILogger.h // BitcoinKit // // Created by Jakub Suder on 17.12.2013. // Copyright (c) 2013 Hive Developers. All rights reserved. // typedef NS_ENUM(int, HILoggerLevel) { HILoggerLevelDebug = 1, HILoggerLevelInfo = 2, HILoggerLevelWarn = 3, HILoggerLevelError = 4, }; extern void HILoggerLog(const char *fileName, const char *functionName, int lineNumber, HILoggerLevel level, NSString *message, ...) NS_FORMAT_FUNCTION(5, 6); #define HILogError(...) HILoggerLog(__FILE__, __FUNCTION__, __LINE__, HILoggerLevelError, __VA_ARGS__) #define HILogWarn(...) HILoggerLog(__FILE__, __FUNCTION__, __LINE__, HILoggerLevelWarn, __VA_ARGS__) #define HILogInfo(...) HILoggerLog(__FILE__, __FUNCTION__, __LINE__, HILoggerLevelInfo, __VA_ARGS__) #define HILogDebug(...) HILoggerLog(__FILE__, __FUNCTION__, __LINE__, HILoggerLevelDebug, __VA_ARGS__) @interface HILogger : NSObject @property (strong) void (^logHandler)(const char *fileName, const char *functionName, int lineNumber, HILoggerLevel level, NSString *message); + (instancetype)sharedLogger; @end
hivewallet/BitcoinKit
BitcoinJKit/HILogger.h
C
mit
1,149
class ChannelOrder(object): """ Helper class to automatically convert string values into tuple values needed to define color channel order. """ RGB = 0, 1, 2 RBG = 0, 2, 1 GRB = 1, 0, 2 GBR = 1, 2, 0 BRG = 2, 0, 1 BGR = 2, 1, 0 ORDERS = RGB, RBG, GRB, GBR, BRG, BGR @staticmethod def make(x): orders = ChannelOrder.ORDERS try: length = len(x) except: return orders[x % len(orders)] if length != 3: raise ValueError('ChannelOrder "%s" does not have length 3' % x) try: s = x.lower() except AttributeError: s = tuple(x) else: try: s = tuple('rgb'.index(i) for i in s) except ValueError: raise ValueError('ChannelOrder "%s" has non-rgb elements' % x) if not all(0 <= x <= 2 for x in s): raise ValueError( 'ChannelOrder %s has members not between 0 and 2.' % x) try: # Canonicalize and detect dupes at the same time. return orders[orders.index(s)] except: raise ValueError('ChannelOrder %s has duplicate elements' % x)
rec/BiblioPixel
bibliopixel/drivers/channel_order.py
Python
mit
1,234
import java.util.List; import java.util.Map; import java.io.IOException; import java.io.File; import java.io.FileOutputStream; import java.io.PrintStream; import java.io.FileWriter; import java.util.Date; import java.text.SimpleDateFormat; import java.text.ParseException; import org.jfree.chart.ChartUtilities; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.Plot; import org.jfree.chart.plot.XYPlot; import com.ibm.nmon.util.ParserLog; import com.ibm.nmon.interval.Interval; import com.ibm.nmon.data.DataSet; import com.ibm.nmon.data.ProcessDataSet; import com.ibm.nmon.gui.chart.data.DataTupleDataset; import com.ibm.nmon.gui.chart.ChartFactory; import com.ibm.nmon.report.ReportCache; import com.ibm.nmon.chart.definition.BaseChartDefinition; import com.ibm.nmon.util.CSVWriter; import com.ibm.nmon.util.GranularityHelper; import com.ibm.nmon.util.TimeFormatCache; import com.ibm.nmon.util.TimeHelper; import com.ibm.nmon.util.FileHelper; import com.ibm.nmon.file.CombinedFileFilter; public final class ReportGenerator extends NMONVisualizerApp { private static final SimpleDateFormat FILE_TIME_FORMAT = new SimpleDateFormat("HHmmss"); public static void main(String[] args) { if (args.length == 0) { System.err.println("no path(s) to parse specified"); return; } // ensure the Swing GUI does not pop up or cause XWindows errors System.setProperty("java.awt.headless", "true"); try { // initialize logging from the classpath properties file java.util.logging.LogManager.getLogManager().readConfiguration( ReportGenerator.class.getResourceAsStream("/cmdline.logging.properties")); } catch (IOException ioe) { System.err.println("cannot initialize logging, will output to System.out"); ioe.printStackTrace(); } List<String> paths = new java.util.ArrayList<String>(); List<String> customDataCharts = new java.util.ArrayList<String>(); List<String> customSummaryCharts = new java.util.ArrayList<String>(); List<String> multiplexedFieldCharts = new java.util.ArrayList<String>(); List<String> multiplexedTypeCharts = new java.util.ArrayList<String>(); String intervalsFile = ""; boolean summaryCharts = true; boolean dataSetCharts = true; long startTime = Interval.DEFAULT.getStart(); long endTime = Interval.DEFAULT.getEnd(); boolean writeRawData = false; boolean writeChartData = false; for (int i = 0; i < args.length; i++) { String arg = args[i]; char c = arg.charAt(0); if (c == '-') { nextarg: for (int j = 1; j < arg.length(); j++) { c = arg.charAt(j); switch (c) { case 's': try { startTime = parseTime(args, ++i, 's'); break nextarg; } catch (IllegalArgumentException iae) { System.err.println(iae.getMessage()); return; } case 'e': try { endTime = parseTime(args, ++i, 'e'); break nextarg; } catch (IllegalArgumentException iae) { System.err.println(iae.getMessage()); return; } case 'd': { ++i; if (i > args.length) { System.err.println("file must be specified for " + '-' + 'd'); return; } customDataCharts.add(args[i]); break nextarg; } case 'a': { ++i; if (i > args.length) { System.err.println("file must be specified for " + '-' + 'a'); return; } customSummaryCharts.add(args[i]); break nextarg; } case 'i': { ++i; if (i > args.length) { System.err.println("file must be specified for " + '-' + 's'); return; } intervalsFile = args[i]; break nextarg; } case '-': { if (j == 1) { // --param String param = arg.substring(2); if ("nodata".equals(param)) { dataSetCharts = false; } else if ("nosummary".equals(param)) { summaryCharts = false; } else if ("mf".equals(param)) { ++i; if (i > args.length) { System.err.println("file must be specified for " + '-' + '-' + "mf"); return; } multiplexedFieldCharts.add(args[i]); } else if ("mt".equals(param)) { ++i; if (i > args.length) { System.err.println("file must be specified for " + '-' + '-' + "mt"); return; } multiplexedTypeCharts.add(args[i]); } else if ("rawdata".equals(param)) { writeRawData = true; } else if ("chartdata".equals(param)) { writeChartData = true; } else { System.err.println("ignoring " + "unknown parameter " + '-' + '-' + param); } break nextarg; } else { System.err.println("ignoring " + "misplaced dash in " + arg); break; } } default: System.err.println("ignoring " + "unknown parameter " + '-' + c); } } } else { // arg does not start with '-', assume file / directory paths.add(arg); } } boolean createCharts = true; if (!summaryCharts && !dataSetCharts && customDataCharts.isEmpty() && customSummaryCharts.isEmpty()) { System.out.println("--" + "nodata" + ", " + "--" + "nosummary" + " were specifed and no custom chart definitions (-d or -a) were given: no charts will be output"); createCharts = false; } if (paths.isEmpty()) { System.err.println("no path(s) to parse specified"); return; } List<String> filesToParse = new java.util.ArrayList<String>(); // find all NMON files for (String path : paths) { File pathToParse = new File(path); FileHelper.recurseDirectories(java.util.Collections.singletonList(pathToParse), CombinedFileFilter.getInstance(false), filesToParse); if (filesToParse.isEmpty()) { System.err.println('\'' + pathToParse.toString() + "' contains no parsable files"); return; } } ReportGenerator generator = new ReportGenerator(customSummaryCharts, customDataCharts, multiplexedFieldCharts, multiplexedTypeCharts); File outputDirectory = null; if (paths.size() == 1) { // all subsequent output goes into the directory given by the user outputDirectory = new File(paths.get(0)); } else { // otherwise, use the current working directory outputDirectory = new File(System.getProperty("user.dir")); } generator.outputDirectory = outputDirectory.isDirectory() ? outputDirectory : outputDirectory.getParentFile(); generator.writeChartData = writeChartData; // parse files generator.parse(filesToParse); // parse intervals if (!"".equals(intervalsFile)) { try { generator.getIntervalManager().loadFromFile(new File(intervalsFile), 0); } catch (IOException ioe) { System.err.println("cannot load intervals from '" + intervalsFile + "'"); ioe.printStackTrace(); } } // set interval after parse so min and max system times are set generator.createIntervalIfNecessary(startTime, endTime); if (createCharts) { if (generator.getIntervalManager().getIntervalCount() != 0) { // create charts for all intervals for (Interval interval : generator.getIntervalManager().getIntervals()) { generator.createReport(interval, summaryCharts, dataSetCharts); } } else { generator.createReport(Interval.DEFAULT, summaryCharts, dataSetCharts); } System.out.println("Charts complete!"); } if (writeRawData) { if (createCharts) { System.out.println(); } if (generator.getIntervalManager().getIntervalCount() != 0) { // write data for all intervals for (Interval interval : generator.getIntervalManager().getIntervals()) { generator.writeRawData(interval); } } else { generator.writeRawData(Interval.DEFAULT); } System.out.println("Raw data complete!"); } } private static long parseTime(String[] args, int index, char param) { if (index > args.length) { throw new IllegalArgumentException("time must be specified for " + '-' + param); } try { return TimeHelper.TIMESTAMP_FORMAT_ISO.parse(args[index]).getTime(); } catch (ParseException pe) { throw new IllegalArgumentException("time specified for " + '-' + param + " (" + args[index] + ") is not valid"); } } private final GranularityHelper granularityHelper; private final ChartFactory factory; private final ReportCache cache; private final List<String> customSummaryCharts; private final List<String> customDataCharts; private final List<String> multiplexedFieldCharts; private final List<String> multiplexedTypeCharts; private File outputDirectory; private boolean writeChartData = false; private ReportGenerator(List<String> customSummaryCharts, List<String> customDataCharts, List<String> multiplexedFieldCharts, List<String> multiplexedTypeCharts) { factory = new ChartFactory(this); cache = new ReportCache(); granularityHelper = new GranularityHelper(this); granularityHelper.setAutomatic(true); this.customSummaryCharts = customSummaryCharts; this.customDataCharts = customDataCharts; this.multiplexedFieldCharts = multiplexedFieldCharts; this.multiplexedTypeCharts = multiplexedTypeCharts; // load chart definitions for (String file : customSummaryCharts) { parseChartDefinition(file); } for (String file : customDataCharts) { parseChartDefinition(file); } for (String file : multiplexedFieldCharts) { parseChartDefinition(file); } for (String file : multiplexedTypeCharts) { parseChartDefinition(file); } } private void parse(List<String> filesToParse) { // avoid logging parsing errors to console ParserLog log = ParserLog.getInstance(); java.util.logging.Logger.getLogger(log.getLogger().getName()).setUseParentHandlers(false); Map<String, String> errors = new java.util.LinkedHashMap<String, String>(); System.out.println("Parsing NMON files..."); for (String fileToParse : filesToParse) { System.out.print("\t" + fileToParse + "... "); System.out.flush(); log.setCurrentFilename(fileToParse); try { parse(fileToParse, getDisplayTimeZone()); if (log.hasData()) { System.out.println("Complete with errors!"); } else { System.out.println("Complete"); } } catch (Exception e) { log.getLogger().error("could not parse " + fileToParse, e); System.out.println("Complete with errors!"); // continue parsing other files } if (log.hasData()) { errors.put(log.getCurrentFilename(), log.getMessages()); } } System.out.println("Parsing complete!"); if (!errors.isEmpty()) { File errorFile = new File(outputDirectory, "ReportGenerator_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(System.currentTimeMillis()) + ".log"); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(errorFile)); } catch (IOException io) { System.err.println("could not create error log file '" + errorFile.getAbsolutePath() + "'; no output will be logged"); return; } for (String filename : errors.keySet()) { out.print(filename); out.println(':'); out.println(errors.get(filename)); } out.close(); System.out.println(); System.out.println("Errors written to " + errorFile); } // reset specifically so errors in ChartDefinitionParser _will_ go to the console java.util.logging.Logger.getLogger(ParserLog.getInstance().getLogger().getName()).setUseParentHandlers(true); } private void parseChartDefinition(String definitionFile) { try { // use the file name as the key cache.addReport(definitionFile, definitionFile); } catch (IOException ioe) { System.err.println("cannot parse chart definition " + definitionFile); ioe.printStackTrace(); } } private void createIntervalIfNecessary(long startTime, long endTime) { if (startTime == Interval.DEFAULT.getStart()) { startTime = getMinSystemTime(); } if (endTime == Interval.DEFAULT.getEnd()) { endTime = getMaxSystemTime(); } Interval toChart = null; if ((startTime == getMinSystemTime() && (endTime == getMaxSystemTime()))) { toChart = Interval.DEFAULT; } else { try { toChart = new Interval(startTime, endTime); } catch (Exception e) { System.err.println("invalid start and end times: " + e.getMessage()); System.err.println("The default interval will be used instead"); toChart = Interval.DEFAULT; } } getIntervalManager().addInterval(toChart); } private void createReport(Interval interval, boolean summaryCharts, boolean dataSetCharts) { System.out.println(); getIntervalManager().setCurrentInterval(interval); System.out.println("Charting interval " + TimeFormatCache.formatInterval(interval)); File chartsDirectory = createSubdirectory("charts", interval); int chartsCreated = 0; System.out.println("Writing charts to " + chartsDirectory.getAbsolutePath()); if (summaryCharts) { chartsCreated += createSummaryCharts("Creating summary charts", ReportCache.DEFAULT_SUMMARY_CHARTS_KEY, chartsDirectory); } if (dataSetCharts) { for (DataSet data : getDataSets()) { chartsCreated += createDataSetCharts("Creating charts for " + data.getHostname(), ReportCache.DEFAULT_DATASET_CHARTS_KEY, chartsDirectory, data); } } for (String file : customSummaryCharts) { chartsCreated += createSummaryCharts("Creating charts for " + file, file, chartsDirectory); } for (String file : customDataCharts) { for (DataSet data : getDataSets()) { chartsCreated += createDataSetCharts("Creating charts for " + file + " (" + data.getHostname() + ")", file, chartsDirectory, data); } } for (String file : multiplexedFieldCharts) { for (DataSet data : getDataSets()) { chartsCreated += multiplexChartsAcrossFields( "Multiplexing charts for " + file + " (" + data.getHostname() + ") across " + "fields", file, chartsDirectory, data); } } for (String file : multiplexedTypeCharts) { for (DataSet data : getDataSets()) { chartsCreated += multiplexChartsAcrossTypes( "Multiplexing charts for " + file + " (" + data.getHostname() + ") across " + "types", file, chartsDirectory, data); } } // remove charts directory if nothing was output if (chartsCreated == 0) { chartsDirectory.delete(); } } private int createSummaryCharts(String message, String key, File chartsDirectory) { int chartsCreated = 0; Iterable<? extends DataSet> dataSets = getDataSets(); List<BaseChartDefinition> report = cache.getReport(key, dataSets); if (!report.isEmpty()) { System.out.print("\t" + message + " "); System.out.flush(); for (BaseChartDefinition definition : report) { if (saveChart(definition, dataSets, chartsDirectory)) { ++chartsCreated; } } System.out.println(" Complete (" + chartsCreated + '/' + report.size() + ")"); } return chartsCreated; } private int createDataSetCharts(String message, String key, File chartsDirectory, DataSet data) { int chartsCreated = 0; Iterable<? extends DataSet> dataSets = java.util.Collections.singletonList(data); List<BaseChartDefinition> report = cache.getReport(key, dataSets); if (!report.isEmpty()) { System.out.print("\t" + message + " "); System.out.flush(); File datasetDirectory = new File(chartsDirectory, data.getHostname()); datasetDirectory.mkdir(); for (BaseChartDefinition definition : report) { if (saveChart(definition, dataSets, datasetDirectory)) { ++chartsCreated; } } if (chartsCreated == 0) { datasetDirectory.delete(); } System.out.println(" Complete (" + chartsCreated + '/' + report.size() + ")"); } return chartsCreated; } private int multiplexChartsAcrossTypes(String message, String key, File chartsDirectory, DataSet data) { int chartsCreated = 0; List<BaseChartDefinition> report = cache.multiplexChartsAcrossTypes(key, data, true); if (!report.isEmpty()) { System.out.print("\t" + message + " "); System.out.flush(); Iterable<? extends DataSet> dataSets = java.util.Collections.singletonList(data); File datasetDirectory = new File(chartsDirectory, data.getHostname()); datasetDirectory.mkdir(); for (BaseChartDefinition definition : report) { if (saveChart(definition, dataSets, datasetDirectory)) { ++chartsCreated; } } if (chartsCreated == 0) { datasetDirectory.delete(); } System.out.println(" Complete (" + chartsCreated + '/' + report.size() + ")"); } return chartsCreated; } private int multiplexChartsAcrossFields(String message, String key, File chartsDirectory, DataSet data) { int chartsCreated = 0; List<BaseChartDefinition> report = cache.multiplexChartsAcrossFields(key, data, true); if (!report.isEmpty()) { System.out.print("\t" + message + " "); System.out.flush(); Iterable<? extends DataSet> dataSets = java.util.Collections.singletonList(data); File datasetDirectory = new File(chartsDirectory, data.getHostname()); datasetDirectory.mkdir(); for (BaseChartDefinition definition : report) { if (saveChart(definition, dataSets, datasetDirectory)) { ++chartsCreated; } } if (chartsCreated == 0) { datasetDirectory.delete(); } System.out.println(" Complete (" + chartsCreated + '/' + report.size() + ")"); } return chartsCreated; } private boolean saveChart(BaseChartDefinition definition, Iterable<? extends DataSet> dataSets, File saveDirectory) { JFreeChart chart = factory.createChart(definition, dataSets); if (chartHasData(chart)) { File chartFile = new File(saveDirectory, definition.getShortName() + ".png"); try { ChartUtilities.saveChartAsPNG(chartFile, chart, definition.getWidth(), definition.getHeight()); } catch (IOException ioe) { System.err.println("cannot create chart " + chartFile.getName()); } if (writeChartData) { writeChartData(chart, definition, saveDirectory); } System.out.print('.'); System.out.flush(); return true; } else { return false; } } private void writeRawData(Interval interval) { System.out.println("Writing data for interval " + TimeFormatCache.formatInterval(interval)); File rawDirectory = createSubdirectory("rawdata", interval); System.out.println("Writing CSV files to " + rawDirectory.getAbsolutePath()); for (DataSet data : getDataSets()) { if (data.getRecordCount(interval) == 0) { System.out.println("\tNo data for " + data.getHostname() + " during the interval"); continue; } System.out.print("\tWriting CSV for " + data.getHostname() + " ... "); System.out.flush(); File dataFile = new File(rawDirectory, data.getHostname() + ".csv"); FileWriter writer = null; try { writer = new FileWriter(dataFile); CSVWriter.write(data, interval, writer); System.out.println("Complete"); } catch (IOException ioe) { System.err.println("could not output raw data to " + dataFile.getName()); } finally { if (writer != null) { try { writer.close(); } catch (IOException ioe) { // ignore } } } if (data instanceof ProcessDataSet) { ProcessDataSet processData = (ProcessDataSet) data; if (processData.getProcessCount() == 0) { continue; } dataFile = new File(rawDirectory, data.getHostname() + "_processes" + ".csv"); writer = null; try { writer = new FileWriter(dataFile); CSVWriter.writeProcesses(data, writer); System.out.println("Complete"); } catch (IOException ioe) { System.err.println("could not output raw data to " + dataFile.getName()); } finally { if (writer != null) { try { writer.close(); } catch (IOException ioe) { // ignore } } } } } } private void writeChartData(JFreeChart chart, BaseChartDefinition definition, File saveDirectory) { File csvFile = new File(saveDirectory, definition.getShortName() + ".csv"); FileWriter writer = null; Plot plot = chart.getPlot(); DataTupleDataset dataset = null; if (plot instanceof CategoryPlot) { CategoryPlot cPlot = (CategoryPlot) plot; dataset = (DataTupleDataset) cPlot.getDataset(); } else if (plot instanceof XYPlot) { XYPlot xyPlot = (XYPlot) plot; dataset = (DataTupleDataset) xyPlot.getDataset(); } else { System.err.println("unknown plot type " + plot.getClass() + " for chart " + chart.getTitle()); } if (dataset != null) { try { writer = new FileWriter(csvFile); CSVWriter.write(dataset, writer); } catch (IOException ioe) { System.err.println("could not output raw data to " + csvFile.getName()); } finally { if (writer != null) { try { writer.close(); } catch (IOException ioe) { // ignore } } } } } private File createSubdirectory(String subDirName, Interval interval) { File toCreate = null; // put in base charts directory if the default interval or there is only a single interval if (getIntervalManager().getIntervalCount() <= 1) { toCreate = new File(outputDirectory, subDirName); } else { // use the interval name if possible if ("".equals(interval.getName())) { toCreate = new File(outputDirectory, subDirName + '/' + FILE_TIME_FORMAT.format(new Date(interval.getStart())) + '-' + FILE_TIME_FORMAT.format(new Date(interval.getEnd()))); } else { toCreate = new File(outputDirectory, subDirName + '/' + interval.getName()); } } toCreate.mkdirs(); return toCreate; } private boolean chartHasData(JFreeChart chart) { boolean hasData = false; // determine if there will really be any data to display // do not output a chart if there is no data Plot plot = chart.getPlot(); if (plot instanceof CategoryPlot) { CategoryPlot cPlot = (CategoryPlot) plot; outer: for (int i = 0; i < cPlot.getDatasetCount(); i++) { for (int j = 0; j < cPlot.getDataset(i).getRowCount(); j++) { for (int k = 0; k < cPlot.getDataset(i).getColumnCount(); k++) { Number value = cPlot.getDataset(0).getValue(j, k); if ((value != null) && !Double.isNaN(value.doubleValue())) { hasData = true; break outer; } } } } } else if (plot instanceof XYPlot) { XYPlot xyPlot = (XYPlot) plot; for (int i = 0; i < xyPlot.getDatasetCount(); i++) { if (xyPlot.getDataset(i).getSeriesCount() > 0) { hasData = true; break; } } } else { System.err.println("unknown plot type " + plot.getClass() + " for chart " + chart.getTitle()); } return hasData; } @Override public void currentIntervalChanged(Interval interval) { super.currentIntervalChanged(interval); granularityHelper.recalculate(); factory.setInterval(interval); factory.setGranularity(granularityHelper.getGranularity()); } }
mhcrnl/java-3
travel-agency-platform/test/ReportGenerator.java
Java
mit
29,601
--- layout: refresh refresh_to_post_id: /2014/11/09/conscious-culture-creation-and-the-community-mastery-board ---
artbrock/artbrock.github.io
node/90/index.md
Markdown
mit
115
go-homework =========== Homework assignments for the Go course in FMI
fmi/go-homework
README.md
Markdown
mit
72
var stripAnsi = require('strip-ansi'); var jsStringEscape = require('js-string-escape'); // webpack is expected to be installed by the gem consumer (eg. the app) var RawSource = require('webpack/lib/RawSource'); var errorTypePattern = /ModuleBuildError:[^:]*: /g; // a webpack plugin to inject js which renders a message upon error function ErrorMessagePlugin() {} ErrorMessagePlugin.prototype.apply = function(compiler) { // if there are errors, replace the output of any bundles with an error message compiler.plugin('emit', function(compilation, done) { if (compilation.errors.length > 0) { var errorJsCode = renderErrorJsCode(compilation.errors); Object.keys(compilation.assets) .filter(isABundle) // don't mess with hot-update assets .forEach(function(assetName) { compilation.assets[assetName] = new RawSource(errorJsCode); }); } done(); }.bind(this)); }; function isABundle(assetName) { return /\.bundle\./.test(assetName); } function renderErrorJsCode(errors) { var cleanedErrorMessage = cleanCompilationErrorMessages(errors); var errorPageHeader = ''+ '<style>body { font-family: sans-serif; }</style>'+ '<h1>Webpack Build Error</h1>'; var errorJsCode = ''+ 'document.body.className += " webpack-build-error";'+ 'document.body.innerHTML = "'+errorPageHeader+'";\n'+ 'var errorDisplay = document.createElement("pre");\n'+ 'errorDisplay.textContent = "'+jsStringEscape(cleanedErrorMessage)+'";\n'+ 'document.body.appendChild(errorDisplay);\n'; return errorJsCode; } function cleanCompilationErrorMessages(errors) { var errorMessages = errors.map(formatError); return stripAnsi(errorMessages.join('\n\n')).replace(errorTypePattern, ''); } // from webpack/lib/Stats.js function formatError(e) { var requestShortener = { shorten: function(request) { return request; }, }; var showErrorDetails = true; var text = ""; if(typeof e === "string") e = { message: e }; if(e.chunk) { text += "chunk " + (e.chunk.name || e.chunk.id) + (e.chunk.entry ? " [entry]" : e.chunk.initial ? " [initial]" : "") + "\n"; } if(e.file) { text += e.file + "\n"; } if(e.module && e.module.readableIdentifier && typeof e.module.readableIdentifier === "function") { text += e.module.readableIdentifier(requestShortener) + "\n"; } text += e.message; if(showErrorDetails && e.details) text += "\n" + e.details; if(showErrorDetails && e.missing) text += e.missing.map(function(item) { return "\n[" + item + "]"; }).join(""); if(e.dependencies && e.origin) { text += "\n @ " + e.origin.readableIdentifier(requestShortener); e.dependencies.forEach(function(dep) { if(!dep.loc) return; if(typeof dep.loc === "string") return; if(!dep.loc.start) return; if(!dep.loc.end) return; text += " " + dep.loc.start.line + ":" + dep.loc.start.column + "-" + (dep.loc.start.line !== dep.loc.end.line ? dep.loc.end.line + ":" : "") + dep.loc.end.column; }); } return text; } module.exports = ErrorMessagePlugin;
cultureamp/webpack_rails
lib/webpack_rails/ErrorMessagePlugin.js
JavaScript
mit
3,116
<?php /** * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Checkout\Model; /** * Class AgreementsValidator */ class AgreementsValidator implements \Magento\Checkout\Api\AgreementsValidatorInterface { /** * Default validator * * @param int[] $agreementIds * * @return bool * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @codeCoverageIgnore */ public function isValid($agreementIds = []) { return true; } }
j-froehlich/magento2_wk
vendor/magento/module-checkout/Model/AgreementsValidator.php
PHP
mit
550
<?php /* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the MIT license. */ namespace OcraElasticSearch\Serializer; /** * Interface for objects capable of converting objects to arrays * * @author Marco Pivetta <[email protected]> * @license MIT */ interface SerializerInterface { /** * @param object $object * * @throws \OcraElasticSearch\Exception\UnknownObjectTypeException when an unknown object type is provided * * @return array */ public function getIdentifier($object); }
Ocramius/OcraElasticSearch
src/OcraElasticSearch/Serializer/SerializerInterface.php
PHP
mit
1,374
//================================================================================== // Copyright (c) 2016 , Advanced Micro Devices, Inc. All rights reserved. // /// \author AMD Developer Tools Team /// \file suInteroperabilityHelper.h /// //================================================================================== //------------------------------ suInteroperabilityHelper.h ------------------------------ #ifndef __SUINTEROPERABILITYHELPER_H #define __SUINTEROPERABILITYHELPER_H // Local: #include <AMDTServerUtilities/Include/suSpiesUtilitiesDLLBuild.h> // ---------------------------------------------------------------------------------- // Class Name: SU_API suInteroperabilityHelper // General Description: A class used to help interoperability between different APIs // Any sort of information or flags that need to be passed between // two different API servers (also without knowing which ones are // already loaded) should be placed here). // Author: Uri Shomroni // Creation Date: 9/11/2011 // ---------------------------------------------------------------------------------- class SU_API suInteroperabilityHelper { private: friend class suSingletonsDelete; public: static suInteroperabilityHelper& instance(); ~suInteroperabilityHelper(); // Nested functions: void onNestedFunctionEntered() {_nestedFunctionCount++;}; void onNestedFunctionExited(); bool isInNestedFunction() {return (_nestedFunctionCount > 0);}; private: // The constructor should only be called by the instance() function: suInteroperabilityHelper(); private: // My single instance: static suInteroperabilityHelper* _pMySingleInstance; // This integer contain the amount of certain API calls (such as WGL function calls). // Some API functions call other nested functions through dynamic linking instead of static linking. // This variable is used preventing the API servers from logging the function call and doing other // redundant works in such cases. int _nestedFunctionCount; }; #endif //__SUINTEROPERABILITYHELPER_H
ilangal-amd/CodeXL
CodeXL/Components/GpuDebugging/AMDTServerUtilities/Include/suInteroperabilityHelper.h
C
mit
2,182
(function() { /*jshint bitwise: false*/ 'use strict'; angular .module('noodleApp') .factory('Base64', Base64); function Base64 () { var keyStr = 'ABCDEFGHIJKLMNOP' + 'QRSTUVWXYZabcdef' + 'ghijklmnopqrstuv' + 'wxyz0123456789+/' + '='; var service = { decode : decode, encode : encode }; return service; function encode (input) { var output = '', chr1, chr2, chr3 = '', enc1, enc2, enc3, enc4 = '', i = 0; while (i < input.length) { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); chr1 = chr2 = chr3 = ''; enc1 = enc2 = enc3 = enc4 = ''; } return output; } function decode (input) { var output = '', chr1, chr2, chr3 = '', enc1, enc2, enc3, enc4 = '', i = 0; // remove all characters that are not A-Z, a-z, 0-9, +, /, or = input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); while (i < input.length) { enc1 = keyStr.indexOf(input.charAt(i++)); enc2 = keyStr.indexOf(input.charAt(i++)); enc3 = keyStr.indexOf(input.charAt(i++)); enc4 = keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 !== 64) { output = output + String.fromCharCode(chr2); } if (enc4 !== 64) { output = output + String.fromCharCode(chr3); } chr1 = chr2 = chr3 = ''; enc1 = enc2 = enc3 = enc4 = ''; } } } })();
JulianMaurin/noodle
src/main/webapp/app/components/util/base64.service.js
JavaScript
mit
2,645
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\VarDumper\Tests\Caster; use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Test\VarDumperTestTrait; /** * @author Grégoire Pineau <[email protected]> */ class SplCasterTest extends TestCase { use VarDumperTestTrait; public function getCastFileInfoTests() { return array( array(__FILE__, <<<'EOTXT' SplFileInfo { %Apath: "%sCaster" filename: "SplCasterTest.php" basename: "SplCasterTest.php" pathname: "%sSplCasterTest.php" extension: "php" realPath: "%sSplCasterTest.php" aTime: %s-%s-%d %d:%d:%d mTime: %s-%s-%d %d:%d:%d cTime: %s-%s-%d %d:%d:%d inode: %d size: %d perms: 0%d owner: %d group: %d type: "file" writable: true readable: true executable: false file: true dir: false link: false %A} EOTXT ), array('https://google.com/about', <<<'EOTXT' SplFileInfo { %Apath: "https://google.com" filename: "about" basename: "about" pathname: "https://google.com/about" extension: "" realPath: false %A} EOTXT ), ); } /** @dataProvider getCastFileInfoTests */ public function testCastFileInfo($file, $dump) { $this->assertDumpMatchesFormat($dump, new \SplFileInfo($file)); } public function testCastFileObject() { $var = new \SplFileObject(__FILE__); $var->setFlags(\SplFileObject::DROP_NEW_LINE | \SplFileObject::SKIP_EMPTY); $dump = <<<'EOTXT' SplFileObject { %Apath: "%sCaster" filename: "SplCasterTest.php" basename: "SplCasterTest.php" pathname: "%sSplCasterTest.php" extension: "php" realPath: "%sSplCasterTest.php" aTime: %s-%s-%d %d:%d:%d mTime: %s-%s-%d %d:%d:%d cTime: %s-%s-%d %d:%d:%d inode: %d size: %d perms: 0%d owner: %d group: %d type: "file" writable: true readable: true executable: false file: true dir: false link: false %AcsvControl: array:%d [ 0 => "," 1 => """ %A] flags: DROP_NEW_LINE|SKIP_EMPTY maxLineLen: 0 fstat: array:26 [ "dev" => %d "ino" => %d "nlink" => %d "rdev" => 0 "blksize" => %i "blocks" => %i …20 ] eof: false key: 0 } EOTXT; $this->assertDumpMatchesFormat($dump, $var); } /** * @dataProvider provideCastSplDoublyLinkedList */ public function testCastSplDoublyLinkedList($modeValue, $modeDump) { $var = new \SplDoublyLinkedList(); $var->setIteratorMode($modeValue); $dump = <<<EOTXT SplDoublyLinkedList { %Amode: $modeDump dllist: [] } EOTXT; $this->assertDumpMatchesFormat($dump, $var); } public function provideCastSplDoublyLinkedList() { return array( array(\SplDoublyLinkedList::IT_MODE_FIFO, 'IT_MODE_FIFO | IT_MODE_KEEP'), array(\SplDoublyLinkedList::IT_MODE_LIFO, 'IT_MODE_LIFO | IT_MODE_KEEP'), array(\SplDoublyLinkedList::IT_MODE_FIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_FIFO | IT_MODE_DELETE'), array(\SplDoublyLinkedList::IT_MODE_LIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_LIFO | IT_MODE_DELETE'), ); } public function testCastObjectStorageIsntModified() { $var = new \SplObjectStorage(); $var->attach(new \stdClass()); $var->rewind(); $current = $var->current(); $this->assertDumpMatchesFormat('%A', $var); $this->assertSame($current, $var->current()); } public function testCastObjectStorageDumpsInfo() { $var = new \SplObjectStorage(); $var->attach(new \stdClass(), new \DateTime()); $this->assertDumpMatchesFormat('%ADateTime%A', $var); } public function testCastArrayObject() { if (\defined('HHVM_VERSION')) { $this->markTestSkipped('HHVM as different internal details.'); } $var = new \ArrayObject(array(123)); $var->foo = 234; $expected = <<<EOTXT ArrayObject { +"foo": 234 flag::STD_PROP_LIST: false flag::ARRAY_AS_PROPS: false iteratorClass: "ArrayIterator" storage: array:1 [ 0 => 123 ] } EOTXT; $this->assertDumpEquals($expected, $var); } public function testArrayIterator() { if (\defined('HHVM_VERSION')) { $this->markTestSkipped('HHVM as different internal details.'); } $var = new MyArrayIterator(array(234)); $expected = <<<EOTXT Symfony\Component\VarDumper\Tests\Caster\MyArrayIterator { -foo: 123 flag::STD_PROP_LIST: false flag::ARRAY_AS_PROPS: false storage: array:1 [ 0 => 234 ] } EOTXT; $this->assertDumpEquals($expected, $var); } } class MyArrayIterator extends \ArrayIterator { private $foo = 123; }
BookOfOrigin/Ori
vendor/symfony/var-dumper/Tests/Caster/SplCasterTest.php
PHP
mit
4,986
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Qt 4.8: newaddresstab.cpp Example File (itemviews/addressbook/newaddresstab.cpp)</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <h1 class="title">newaddresstab.cpp Example File</h1> <span class="small-subtitle">itemviews/addressbook/newaddresstab.cpp</span> <!-- $$$itemviews/addressbook/newaddresstab.cpp-description --> <div class="descr"> <a name="details"></a> <pre class="cpp"> <span class="comment">/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** &quot;Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names ** of its contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&quot; ** ** $QT_END_LICENSE$ ** ****************************************************************************/</span> <span class="preprocessor">#include &lt;QtGui&gt;</span> <span class="preprocessor">#include &quot;newaddresstab.h&quot;</span> <span class="preprocessor">#include &quot;adddialog.h&quot;</span> NewAddressTab<span class="operator">::</span>NewAddressTab(<span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>parent) { Q_UNUSED(parent); descriptionLabel <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlabel.html">QLabel</a></span>(tr(<span class="string">&quot;There are currently no contacts in your address book. &quot;</span> <span class="string">&quot;\nClick Add to add new contacts.&quot;</span>)); addButton <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>(tr(<span class="string">&quot;Add&quot;</span>)); connect(addButton<span class="operator">,</span> SIGNAL(clicked())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(addEntry())); mainLayout <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span>; mainLayout<span class="operator">-</span><span class="operator">&gt;</span>addWidget(descriptionLabel); mainLayout<span class="operator">-</span><span class="operator">&gt;</span>addWidget(addButton<span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>AlignCenter); setLayout(mainLayout); } <span class="type">void</span> NewAddressTab<span class="operator">::</span>addEntry() { AddDialog aDialog; <span class="keyword">if</span> (aDialog<span class="operator">.</span>exec()) { <span class="type"><a href="qstring.html">QString</a></span> name <span class="operator">=</span> aDialog<span class="operator">.</span>nameText<span class="operator">-</span><span class="operator">&gt;</span>text(); <span class="type"><a href="qstring.html">QString</a></span> address <span class="operator">=</span> aDialog<span class="operator">.</span>addressText<span class="operator">-</span><span class="operator">&gt;</span>toPlainText(); <span class="keyword">emit</span> sendDetails(name<span class="operator">,</span> address); } }</pre> </div> <!-- @@@itemviews/addressbook/newaddresstab.cpp --> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>
stephaneAG/PengPod700
QtEsrc/qt-everywhere-opensource-src-4.8.5/doc/html/itemviews-addressbook-newaddresstab-cpp.html
HTML
mit
13,884
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Pulsar4X.Entities; using System.ComponentModel; using Pulsar4X.UI.Helpers; using System.Linq.Expressions; namespace Pulsar4X.UI.ViewModels { public class GLStarSystemViewModel : INotifyPropertyChanged { public BindingList<StarSystem> StarSystems { get; set; } private StarSystem _currentstarsystem; public StarSystem CurrentStarSystem { get { return _currentstarsystem; } set { if (_currentstarsystem != value) { _currentstarsystem = value; OnPropertyChanged(() => CurrentStarSystem); OnStarSystemChanged(); } } } public GLStarSystemViewModel() { CurrentStarSystem = GameState.Instance.StarSystems.FirstOrDefault(); StarSystems = GameState.Instance.StarSystems; } private void OnStarSystemChanged() { if (StarSystemChanged != null) { StarSystemChanged(this, new EventArgs()); } } private void OnPropertyChanged(Expression<Func<object>> property) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(BindingHelper.Name(property))); } } public event PropertyChangedEventHandler PropertyChanged; public event EventHandler StarSystemChanged; } }
kniteli/Pulsar4x
Pulsar4X/Pulsar4X.UI/ViewModels/GLStarSystemViewModel.cs
C#
mit
1,660
# Add all config/locales subdirs I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
benjaminvialle/Markus
config/initializers/02_i18n.rb
Ruby
mit
113
#Scratch_n_sketch scripting from libs.board import * board = scratch_n_sketch() #auto find and connect board.connect() #colors board.backGroundColor(0, 0, 0) board.textBackColor(0, 0, 0) board.penColor(0, 255, 255) #rotate 0 board.rotateDisplay(board.rotate_0) xpos = 0 ypos = 0 #font board.setFont(Font.peanut) board.drawText('Raw', 100, 80); board.drawText('Mapped', 70, 180); board.penColor(255, 0, 255) board.setFont(Font.peanut) """ - touch_in_min_xp 145 - touch_in max_xp 905 - touch_in_min_yp 089 - touch_in max_yp 916 - lcd_in min_xp 0 - lcd_in max_xp 239 - lcd_in min_yp 0 - lcd_in max_yp 319 """ while True: #get sensor data board.getSensorData() #map touch xpos to lcd(0-239) xpos = int(map(board.TouchX, 105, 904, 0, 239)) #map touch xpos to lcd(0-319) ypos = int(map(board.TouchY, 80, 935, 0, 319)) #draw coordinates board.drawText('x : {0:03d} y : {1:03d}'.format(board.TouchX, board.TouchY), 50, 120) board.drawText('x : {0:03d} y : {1:03d}'.format(xpos, ypos), 50, 220) wait(50) #disconnect board board.disconnect()
warefab/scratch-n-sketch
python/touch_lcd_map.py
Python
mit
1,075
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Ship() result.template = "object/ship/player/shared_player_blacksun_medium_s04.iff" result.attribute_template_id = -1 result.stfName("space_ship","player_blacksun_medium_s04") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
anhstudios/swganh
data/scripts/templates/object/ship/player/shared_player_blacksun_medium_s04.py
Python
mit
466
// // AppDelegate.h // CoreTextDemo // // Created by TangQiao on 13-12-3. // Copyright (c) 2013年 TangQiao. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
bigtreenono/NSPTools
HeHe/CoreText/唐巧CoreText/CoreTextDemo/AppDelegate.h
C
mit
279
# distributed-oh-hell-server ``` > npm install > npm start ```
jbuffin/distributed-oh-hell-api
README.md
Markdown
mit
64
/** * @author Richard Davey <[email protected]> * @copyright 2019 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Clamp = require('../../../math/Clamp'); var Class = require('../../../utils/Class'); var Events = require('../events'); /** * @classdesc * A Camera Fade effect. * * This effect will fade the camera viewport to the given color, over the duration specified. * * Only the camera viewport is faded. None of the objects it is displaying are impacted, i.e. their colors do * not change. * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect, if required. * * @class Fade * @memberof Phaser.Cameras.Scene2D.Effects * @constructor * @since 3.5.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon. */ var Fade = new Class({ initialize: function Fade (camera) { /** * The Camera this effect belongs to. * * @name Phaser.Cameras.Scene2D.Effects.Fade#camera * @type {Phaser.Cameras.Scene2D.Camera} * @readonly * @since 3.5.0 */ this.camera = camera; /** * Is this effect actively running? * * @name Phaser.Cameras.Scene2D.Effects.Fade#isRunning * @type {boolean} * @readonly * @default false * @since 3.5.0 */ this.isRunning = false; /** * Has this effect finished running? * * This is different from `isRunning` because it remains set to `true` when the effect is over, * until the effect is either reset or started again. * * @name Phaser.Cameras.Scene2D.Effects.Fade#isComplete * @type {boolean} * @readonly * @default false * @since 3.5.0 */ this.isComplete = false; /** * The direction of the fade. * `true` = fade out (transparent to color), `false` = fade in (color to transparent) * * @name Phaser.Cameras.Scene2D.Effects.Fade#direction * @type {boolean} * @readonly * @since 3.5.0 */ this.direction = true; /** * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Fade#duration * @type {integer} * @readonly * @default 0 * @since 3.5.0 */ this.duration = 0; /** * The value of the red color channel the camera will use for the fade effect. * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#red * @type {integer} * @private * @since 3.5.0 */ this.red = 0; /** * The value of the green color channel the camera will use for the fade effect. * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#green * @type {integer} * @private * @since 3.5.0 */ this.green = 0; /** * The value of the blue color channel the camera will use for the fade effect. * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#blue * @type {integer} * @private * @since 3.5.0 */ this.blue = 0; /** * The value of the alpha channel used during the fade effect. * A value between 0 and 1. * * @name Phaser.Cameras.Scene2D.Effects.Fade#alpha * @type {number} * @private * @since 3.5.0 */ this.alpha = 0; /** * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. * * @name Phaser.Cameras.Scene2D.Effects.Fade#progress * @type {number} * @since 3.5.0 */ this.progress = 0; /** * Effect elapsed timer. * * @name Phaser.Cameras.Scene2D.Effects.Fade#_elapsed * @type {number} * @private * @since 3.5.0 */ this._elapsed = 0; /** * This callback is invoked every frame for the duration of the effect. * * @name Phaser.Cameras.Scene2D.Effects.Fade#_onUpdate * @type {?Phaser.Types.Cameras.Scene2D.CameraFadeCallback} * @private * @default null * @since 3.5.0 */ this._onUpdate; /** * On Complete callback scope. * * @name Phaser.Cameras.Scene2D.Effects.Fade#_onUpdateScope * @type {any} * @private * @since 3.5.0 */ this._onUpdateScope; }, /** * Fades the Camera to or from the given color over the duration specified. * * @method Phaser.Cameras.Scene2D.Effects.Fade#start * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_START * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_START * @since 3.5.0 * * @param {boolean} [direction=true] - The direction of the fade. `true` = fade out (transparent to color), `false` = fade in (color to transparent) * @param {integer} [duration=1000] - The duration of the effect in milliseconds. * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraFadeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. * * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started. */ start: function (direction, duration, red, green, blue, force, callback, context) { if (direction === undefined) { direction = true; } if (duration === undefined) { duration = 1000; } if (red === undefined) { red = 0; } if (green === undefined) { green = 0; } if (blue === undefined) { blue = 0; } if (force === undefined) { force = false; } if (callback === undefined) { callback = null; } if (context === undefined) { context = this.camera.scene; } if (!force && this.isRunning) { return this.camera; } this.isRunning = true; this.isComplete = false; this.duration = duration; this.direction = direction; this.progress = 0; this.red = red; this.green = green; this.blue = blue; this.alpha = (direction) ? Number.MIN_VALUE : 1; this._elapsed = 0; this._onUpdate = callback; this._onUpdateScope = context; var eventName = (direction) ? Events.FADE_OUT_START : Events.FADE_IN_START; this.camera.emit(eventName, this.camera, this, duration, red, green, blue); return this.camera; }, /** * The main update loop for this effect. Called automatically by the Camera. * * @method Phaser.Cameras.Scene2D.Effects.Fade#update * @since 3.5.0 * * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) { if (!this.isRunning) { return; } this._elapsed += delta; this.progress = Clamp(this._elapsed / this.duration, 0, 1); if (this._onUpdate) { this._onUpdate.call(this._onUpdateScope, this.camera, this.progress); } if (this._elapsed < this.duration) { this.alpha = (this.direction) ? this.progress : 1 - this.progress; } else { this.alpha = (this.direction) ? 1 : 0; this.effectComplete(); } }, /** * Called internally by the Canvas Renderer. * * @method Phaser.Cameras.Scene2D.Effects.Fade#postRenderCanvas * @since 3.5.0 * * @param {CanvasRenderingContext2D} ctx - The Canvas context to render to. * * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`. */ postRenderCanvas: function (ctx) { if (!this.isRunning && !this.isComplete) { return false; } var camera = this.camera; ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')'; ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch); return true; }, /** * Called internally by the WebGL Renderer. * * @method Phaser.Cameras.Scene2D.Effects.Fade#postRenderWebGL * @since 3.5.0 * * @param {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} pipeline - The WebGL Pipeline to render to. * @param {function} getTintFunction - A function that will return the gl safe tint colors. * * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`. */ postRenderWebGL: function (pipeline, getTintFunction) { if (!this.isRunning && !this.isComplete) { return false; } var camera = this.camera; var red = this.red / 255; var blue = this.blue / 255; var green = this.green / 255; pipeline.drawFillRect( camera._cx, camera._cy, camera._cw, camera._ch, getTintFunction(red, green, blue, 1), this.alpha ); return true; }, /** * Called internally when the effect completes. * * @method Phaser.Cameras.Scene2D.Effects.Fade#effectComplete * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE * @since 3.5.0 */ effectComplete: function () { this._onUpdate = null; this._onUpdateScope = null; this.isRunning = false; this.isComplete = true; var eventName = (this.direction) ? Events.FADE_OUT_COMPLETE : Events.FADE_IN_COMPLETE; this.camera.emit(eventName, this.camera, this); }, /** * Resets this camera effect. * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. * * @method Phaser.Cameras.Scene2D.Effects.Fade#reset * @since 3.5.0 */ reset: function () { this.isRunning = false; this.isComplete = false; this._onUpdate = null; this._onUpdateScope = null; }, /** * Destroys this effect, releasing it from the Camera. * * @method Phaser.Cameras.Scene2D.Effects.Fade#destroy * @since 3.5.0 */ destroy: function () { this.reset(); this.camera = null; } }); module.exports = Fade;
mahill/phaser
src/cameras/2d/effects/Fade.js
JavaScript
mit
11,680
/* มีเพียง 4 รายการนี้ที่มี zipcode มากกว่า 1 ประจวบคีรีขันธ์ ปราณบุรี ปราณบุรี [ 77120, 77160 ] ประจวบคีรีขันธ์ ปราณบุรี วังก์พง [ 77120, 77160 ] ประจวบคีรีขันธ์ ปราณบุรี หนองตาแต้ม [ 77120, 77160 ] ประจวบคีรีขันธ์ ปราณบุรี เขาจ้าว [ 77120, 77160 ] ประจวบคีรีขันธ์ ปราณบุรี เขาน้อย [ 77120, 77160 ] ประจวบคีรีขันธ์ สามร้อยยอด สามร้อยยอด [ 77120, 77160 ] */ let tree = require('./data.json') let wordcut = require('wordcut') const fs = require('fs') let cnt = 0 let dict = {} let words = {} wordcut.init() // pass 1 generate dict and word list tree.forEach(p => { addToDict(p[0]) p[1].forEach(a => { addToDict(a[0]) a[1].forEach(d => { addToDict(d[0]) }) }) }) console.log('words=', Object.keys(words).length) // processs words sorting top 52 most occurrences let newWords = {} Object.keys(words).sort((a, b) => { // order by descending if (words[a] === words[b]) { return 0 } if (words[a] < words[b]) { return 1 } return -1 }) .filter((word, i) => i < 52) .forEach((word, i) => { newWords[String.fromCharCode(i < 26 ? 65 + i : 97 + i - 26)] = word }) //console.log('most freq word=', Object.keys(newWords).map(idx => [newWords[idx], words[newWords[idx]]])) fs.writeFileSync('words.txt', '|คำ|จำนวนครั้ง|\n' + '|---|---:|\n' + Object.keys(newWords).map(idx => '|' + newWords[idx] + '|' + words[newWords[idx]] + '|').join('\n') ) // process dict keep only 2 or more occurences let newDict = {} let lookup = [] Object.keys(dict).filter(key => dict[key] > 1).forEach(key => { key = changeWord(key) newDict[key] = lookup.length lookup.push(key) }) // pass 2: rebuild tree let newTree = tree.map(p => [findIndex(p[0]), p[1].map(a => [findIndex(a[0]), a[1].map(d => [findIndex(d[0]), d[1].length === 1 ? d[1][0] : d[1]] )] )] ) fs.writeFileSync('./data3.json', JSON.stringify({ data: newTree, lookup: lookup.join('|'), words: Object.keys(newWords).map((ch) => newWords[ch]).join('|'), })) function addToDict(key) { if (typeof dict[key] === 'undefined') { dict[key] = 1 } else { dict[key]++ } let wordList = wordcut.cut(key).split('|') wordList.forEach((word) => { if (typeof words[word] === 'undefined') { words[word] = 1 } else { words[word]++ } }) } function findIndex(key) { key = changeWord(key) return typeof newDict[key] === 'number' ? newDict[key] : key } function changeWord(text) { Object.keys(newWords).forEach(ch => { text = text.replace(newWords[ch], ch) }) return text }
tsctao/vue-thai-address-input
demo/dist/tools/convert.js
JavaScript
mit
2,993
<!DOCTYPE html> <head> <title>Blog</title> <link rel="stylesheet" type="text/css" href="../stylesheets/blog-stylesheet.css"> <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro|Amatic+SC|Raleway' rel='stylesheet' type='text/css'> </head> <main> <div> <h2 class="header">Anna's Blog</h2> </div> <div class="about"> <img src="https://trello-avatars.s3.amazonaws.com/884f6dd879ddc1665c10a3665394930e/170.png"> <div>Anna MacDonald is an aspiring web developer attending Dev Bootcamp in San Francisco.</div></div> <div class="post"> <h3>Values</h3> <h4>February 5, 2014</h4> <p> Here are a list of values that come to mind at times in my life where I've been the happiest in some form or another: Accomplishment, Achievement, Affection, Ambition, Close relationships, Compassion, Competence, Confidence, Creativity, Credibility, Decisiveness, Enthusiasm, Excitement, Friendships, Growth, Helping others, Honesty, Inner harmony, Insight, Inspiration, Location, Meaningful work, Music, Nature, Peace, Personal development, Reputation, Romance, Serenity, Stability, Tranquility, Will-power, Wisdom. In general, I try to live up to these values (4/5) because they are standards that I wish to be held to and wish for others to reciprocate (for those actionable values). </p> <p> One value that is very important to me is inspiration. I believe inspiration is an extremely important value for a person to possess, and I think it is a fairly difficult one to hold on to in times of stress or despair. I have struggled with feeling inspired a lot of my life, so always really treasure moments when I feel inspiration, and look for ways I can inspire other people. Finally, I think that inspiration is closely linked to motivation - which has also been a tough value for me to hold on to - and motivation is so important for success, but more importantly, overall happiness on a day-to-day level. </p> <p> The last topic that someone asked for my advice on was regarding whether they should pursue a bootcamp like DBC. This topic is related to meaningful work, which I think is extremely important, and given my knowledge of my experience so far, I honestly explained all that I could about the various programs and referred them to Code Academy since I have found it the most enjoyable learning resource outside of the DBC materials. I was hoping to enable them to make an informed decision about whether they would enjoy a programming bootcamp. </p> <p> I am happy when I think about my values, although sometimes I wish I cared more about things such as prestige and eventual income mainly because I think it may help with my motivation. I think my values of insight and compassion may help mediate stereotype threat if I feel it because I could understand what is making a person act a certain way that I recognize as stereotype threat. </p> <p> I think the value that I have to work on the most to be successful at DBC is inspiration because I know that if I am able to think of an inspiring project or observe inspiring people in the programming world, that it would help me become more motivated. Since I am very self-aware of moments when I feel lacking in motivation and inspiration, I will need to be able to snap myself out of it and either let it pass or search for sources of inspiration in the community. </p> </div> </main>
AnnaMhairi/AnnaMhairi.github.io
old/blog/c7-values.html
HTML
mit
3,481
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See http://js.arcgis.com/3.17/esri/copyright.txt for details. //>>built define("esri/layers/tiled",["./TiledMapServiceLayer","./TileInfo","./LOD","../geometry","../utils"],function(){return{}});
darklilium/Factigis_2
arcgis_js_api/library/3.17/3.17compact/esri/layers/tiled.js
JavaScript
mit
278
package cli import ( "context" "fmt" "os" "github.com/gopasspw/gopass/internal/backend" "github.com/gopasspw/gopass/pkg/debug" "github.com/gopasspw/gopass/pkg/fsutil" ) const ( name = "gpgcli" ) func init() { backend.RegisterCrypto(backend.GPGCLI, name, &loader{}) } type loader struct{} // New implements backend.CryptoLoader. func (l loader) New(ctx context.Context) (backend.Crypto, error) { debug.Log("Using Crypto Backend: %s", name) return New(ctx, Config{ Umask: fsutil.Umask(), Args: GPGOpts(), Binary: os.Getenv("GOPASS_GPG_BINARY"), }) } func (l loader) Handles(s backend.Storage) error { if s.Exists(context.TODO(), IDFile) { return nil } return fmt.Errorf("not supported") } func (l loader) Priority() int { return 1 } func (l loader) String() string { return name }
justwatchcom/gopass
internal/backend/crypto/gpg/cli/loader.go
GO
mit
815
/** * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/ * Modified by Miles Johnson: http://milesj.me * * Supports the following: * - Extends clike syntax * - Support for PHP 5.3+ (namespaces, traits, generators, etc) * - Smarter constant and function matching * * Adds the following new token classes: * constant, delimiter, variable, function, package */ Prism.languages.php = Prism.languages.extend('clike', { 'keyword': /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/ig, 'constant': /\b[A-Z0-9_]{2,}\b/g, 'comment': { pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])(\/\/).*?(\r?\n|$))/g, lookbehind: true } }); // Shell-like comments are matched after strings, because they are less // common than strings containing hashes... Prism.languages.insertBefore('php', 'class-name', { 'shell-comment': { pattern: /(^|[^\\])#.*?(\r?\n|$)/g, lookbehind: true, alias: 'comment' } }); Prism.languages.insertBefore('php', 'keyword', { 'delimiter': /(\?>|<\?php|<\?)/ig, 'variable': /(\$\w+)\b/ig, 'package': { pattern: /(\\|namespace\s+|use\s+)[\w\\]+/g, lookbehind: true, inside: { punctuation: /\\/ } } }); // Must be defined after the function pattern Prism.languages.insertBefore('php', 'operator', { 'property': { pattern: /(->)[\w]+/g, lookbehind: true } }); // Add HTML support of the markup language exists if (Prism.languages.markup) { // Tokenize all inline PHP blocks that are wrapped in <?php ?> // This allows for easy PHP + markup highlighting Prism.hooks.add('before-highlight', function(env) { if (env.language !== 'php') { return; } env.tokenStack = []; env.backupCode = env.code; env.code = env.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig, function(match) { env.tokenStack.push(match); return '{{{PHP' + env.tokenStack.length + '}}}'; }); }); // Restore env.code for other plugins (e.g. line-numbers) Prism.hooks.add('before-insert', function(env) { if (env.language === 'php') { env.code = env.backupCode; delete env.backupCode; } }); // Re-insert the tokens after highlighting Prism.hooks.add('after-highlight', function(env) { if (env.language !== 'php') { return; } for (var i = 0, t; t = env.tokenStack[i]; i++) { env.highlightedCode = env.highlightedCode.replace('{{{PHP' + (i + 1) + '}}}', Prism.highlight(t, env.grammar, 'php')); } env.element.innerHTML = env.highlightedCode; }); // Wrap tokens in classes that are missing them Prism.hooks.add('wrap', function(env) { if (env.language === 'php' && env.type === 'markup') { env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, "<span class=\"token php\">$1</span>"); } }); // Add the rules before all others Prism.languages.insertBefore('php', 'comment', { 'markup': { pattern: /<[^?]\/?(.*?)>/g, inside: Prism.languages.markup }, 'php': /\{\{\{PHP[0-9]+\}\}\}/g }); }
xbudex/phantom-talk
vendor/prism/components/prism-php.js
JavaScript
mit
3,319
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { createMainContextProxyIdentifier as createMainId, createExtHostContextProxyIdentifier as createExtId, ProxyIdentifier, IThreadService } from 'vs/workbench/services/thread/common/threadService'; import * as vscode from 'vscode'; import URI from 'vs/base/common/uri'; import Severity from 'vs/base/common/severity'; import { TPromise } from 'vs/base/common/winjs.base'; import { IMarkerData } from 'vs/platform/markers/common/markers'; import { Position as EditorPosition } from 'vs/platform/editor/common/editor'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar'; import { ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry'; import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; import { IWorkspace } from 'vs/platform/workspace/common/workspace'; import * as editorCommon from 'vs/editor/common/editorCommon'; import * as modes from 'vs/editor/common/modes'; import { IResourceEdit } from 'vs/editor/common/services/bulkEdit'; import { ITextSource } from 'vs/editor/common/model/textSource'; import { ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IWorkspaceConfigurationValues } from 'vs/workbench/services/configuration/common/configuration'; import { IPickOpenEntry, IPickOptions } from 'vs/platform/quickOpen/common/quickOpen'; import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles'; import { IApplyEditsOptions, IUndoStopOptions, TextEditorRevealType, ITextEditorConfigurationUpdate, IResolvedTextEditorConfiguration, ISelectionChangeEvent } from './mainThreadEditor'; import { InternalTreeExplorerNodeContent } from 'vs/workbench/parts/explorers/common/treeExplorerViewModel'; import { TaskSet } from 'vs/workbench/parts/tasks/common/tasks'; import { IModelChangedEvent } from 'vs/editor/common/model/mirrorModel2'; export interface IEnvironment { enableProposedApi: boolean; appSettingsHome: string; disableExtensions: boolean; userExtensionsHome: string; extensionDevelopmentPath: string; extensionTestsPath: string; } export interface IInitData { parentPid: number; environment: IEnvironment; contextService: { workspace: IWorkspace; }; extensions: IExtensionDescription[]; configuration: IWorkspaceConfigurationValues; telemetryInfo: ITelemetryInfo; } export interface InstanceSetter<T> { set<R extends T>(instance: T): R; } export class InstanceCollection { private _items: { [id: string]: any; }; constructor() { this._items = Object.create(null); } public define<T>(id: ProxyIdentifier<T>): InstanceSetter<T> { let that = this; return new class { set(value: T) { that._set(id, value); return value; } }; } _set<T>(id: ProxyIdentifier<T>, value: T): void { this._items[id.id] = value; } public finish(isMain: boolean, threadService: IThreadService): void { let expected = (isMain ? MainContext : ExtHostContext); Object.keys(expected).forEach((key) => { let id = expected[key]; let value = this._items[id.id]; if (!value) { throw new Error(`Missing actor ${key} (isMain: ${id.isMain}, id: ${id.id})`); } threadService.set<any>(id, value); }); } } function ni() { return new Error('Not implemented'); } // --- main thread export abstract class MainThreadCommandsShape { $registerCommand(id: string): TPromise<any> { throw ni(); } $unregisterCommand(id: string): TPromise<any> { throw ni(); } $executeCommand<T>(id: string, args: any[]): Thenable<T> { throw ni(); } $getCommands(): Thenable<string[]> { throw ni(); } } export abstract class MainThreadConfigurationShape { $updateConfigurationOption(target: ConfigurationTarget, key: string, value: any): TPromise<void> { throw ni(); } $removeConfigurationOption(target: ConfigurationTarget, key: string): TPromise<void> { throw ni(); } } export abstract class MainThreadDiagnosticsShape { $changeMany(owner: string, entries: [URI, IMarkerData[]][]): TPromise<any> { throw ni(); } $clear(owner: string): TPromise<any> { throw ni(); } } export abstract class MainThreadDocumentsShape { $tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<any> { throw ni(); } $tryOpenDocument(uri: URI): TPromise<any> { throw ni(); } $registerTextContentProvider(handle: number, scheme: string): void { throw ni(); } $onVirtualDocumentChange(uri: URI, value: ITextSource): void { throw ni(); } $unregisterTextContentProvider(handle: number): void { throw ni(); } $trySaveDocument(uri: URI): TPromise<boolean> { throw ni(); } } export abstract class MainThreadEditorsShape { $tryShowTextDocument(resource: URI, position: EditorPosition, preserveFocus: boolean): TPromise<string> { throw ni(); } $registerTextEditorDecorationType(key: string, options: editorCommon.IDecorationRenderOptions): void { throw ni(); } $removeTextEditorDecorationType(key: string): void { throw ni(); } $tryShowEditor(id: string, position: EditorPosition): TPromise<void> { throw ni(); } $tryHideEditor(id: string): TPromise<void> { throw ni(); } $trySetOptions(id: string, options: ITextEditorConfigurationUpdate): TPromise<any> { throw ni(); } $trySetDecorations(id: string, key: string, ranges: editorCommon.IDecorationOptions[]): TPromise<any> { throw ni(); } $tryRevealRange(id: string, range: editorCommon.IRange, revealType: TextEditorRevealType): TPromise<any> { throw ni(); } $trySetSelections(id: string, selections: editorCommon.ISelection[]): TPromise<any> { throw ni(); } $tryApplyEdits(id: string, modelVersionId: number, edits: editorCommon.ISingleEditOperation[], opts: IApplyEditsOptions): TPromise<boolean> { throw ni(); } $tryInsertSnippet(id: string, template: string, selections: editorCommon.IRange[], opts: IUndoStopOptions): TPromise<any> { throw ni(); } $getDiffInformation(id: string): TPromise<editorCommon.ILineChange[]> { throw ni(); } } export abstract class MainThreadTreeExplorersShape { $registerTreeExplorerNodeProvider(providerId: string): void { throw ni(); } } export abstract class MainThreadErrorsShape { onUnexpectedExtHostError(err: any): void { throw ni(); } } export abstract class MainThreadLanguageFeaturesShape { $unregister(handle: number): TPromise<any> { throw ni(); } $registerOutlineSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerCodeLensSupport(handle: number, selector: vscode.DocumentSelector, eventHandle: number): TPromise<any> { throw ni(); } $emitCodeLensEvent(eventHandle: number, event?: any): TPromise<any> { throw ni(); } $registerDeclaractionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerImplementationSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerTypeDefinitionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerHoverProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerDocumentHighlightProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerReferenceSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerQuickFixSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerDocumentFormattingSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerRangeFormattingSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerOnTypeFormattingSupport(handle: number, selector: vscode.DocumentSelector, autoFormatTriggerCharacters: string[]): TPromise<any> { throw ni(); } $registerNavigateTypeSupport(handle: number): TPromise<any> { throw ni(); } $registerRenameSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $registerSuggestSupport(handle: number, selector: vscode.DocumentSelector, triggerCharacters: string[]): TPromise<any> { throw ni(); } $registerSignatureHelpProvider(handle: number, selector: vscode.DocumentSelector, triggerCharacter: string[]): TPromise<any> { throw ni(); } $registerDocumentLinkProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); } $setLanguageConfiguration(handle: number, languageId: string, configuration: vscode.LanguageConfiguration): TPromise<any> { throw ni(); } } export abstract class MainThreadLanguagesShape { $getLanguages(): TPromise<string[]> { throw ni(); } } export abstract class MainThreadMessageServiceShape { $showMessage(severity: Severity, message: string, options: vscode.MessageOptions, commands: { title: string; isCloseAffordance: boolean; handle: number; }[]): Thenable<number> { throw ni(); } } export abstract class MainThreadOutputServiceShape { $append(channelId: string, label: string, value: string): TPromise<void> { throw ni(); } $clear(channelId: string, label: string): TPromise<void> { throw ni(); } $dispose(channelId: string, label: string): TPromise<void> { throw ni(); } $reveal(channelId: string, label: string, preserveFocus: boolean): TPromise<void> { throw ni(); } $close(channelId: string): TPromise<void> { throw ni(); } } export abstract class MainThreadProgressShape { $startWindow(handle: number, title: string): void { throw ni(); }; $startScm(handle: number): void { throw ni(); }; $progressReport(handle: number, message: string): void { throw ni(); } $progressEnd(handle: number): void { throw ni(); } } export abstract class MainThreadTerminalServiceShape { $createTerminal(name?: string, shellPath?: string, shellArgs?: string[], waitOnExit?: boolean): TPromise<number> { throw ni(); } $dispose(terminalId: number): void { throw ni(); } $hide(terminalId: number): void { throw ni(); } $sendText(terminalId: number, text: string, addNewLine: boolean): void { throw ni(); } $show(terminalId: number, preserveFocus: boolean): void { throw ni(); } $registerOnData(terminalId: number): void { throw ni(); } } export interface MyQuickPickItems extends IPickOpenEntry { handle: number; } export abstract class MainThreadQuickOpenShape { $show(options: IPickOptions): Thenable<number> { throw ni(); } $setItems(items: MyQuickPickItems[]): Thenable<any> { throw ni(); } $setError(error: Error): Thenable<any> { throw ni(); } $input(options: vscode.InputBoxOptions, validateInput: boolean): TPromise<string> { throw ni(); } } export abstract class MainThreadStatusBarShape { $setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); } $dispose(id: number) { throw ni(); } } export abstract class MainThreadStorageShape { $getValue<T>(shared: boolean, key: string): TPromise<T> { throw ni(); } $setValue(shared: boolean, key: string, value: any): TPromise<any> { throw ni(); } } export abstract class MainThreadTelemetryShape { $publicLog(eventName: string, data?: any): void { throw ni(); } $getTelemetryInfo(): TPromise<ITelemetryInfo> { throw ni(); } } export abstract class MainThreadWorkspaceShape { $startSearch(include: string, exclude: string, maxResults: number, requestId: number): Thenable<URI[]> { throw ni(); } $cancelSearch(requestId: number): Thenable<boolean> { throw ni(); } $saveAll(includeUntitled?: boolean): Thenable<boolean> { throw ni(); } $applyWorkspaceEdit(edits: IResourceEdit[]): TPromise<boolean> { throw ni(); } } export abstract class MainThreadTaskShape { $registerTaskProvider(handle: number): TPromise<any> { throw ni(); } $unregisterTaskProvider(handle: number): TPromise<any> { throw ni(); } } export abstract class MainProcessExtensionServiceShape { $localShowMessage(severity: Severity, msg: string): void { throw ni(); } $onExtensionActivated(extensionId: string): void { throw ni(); } $onExtensionActivationFailed(extensionId: string): void { throw ni(); } } export interface SCMProviderFeatures { hasQuickDiffProvider?: boolean; count?: number; commitTemplate?: string; acceptInputCommand?: modes.Command; statusBarCommands?: modes.Command[]; } export interface SCMGroupFeatures { hideWhenEmpty?: boolean; } export type SCMRawResource = [ number /*handle*/, string /*resourceUri*/, modes.Command /*command*/, string[] /*icons: light, dark*/, boolean /*strike through*/ ]; export abstract class MainThreadSCMShape { $registerSourceControl(handle: number, id: string, label: string): void { throw ni(); } $updateSourceControl(handle: number, features: SCMProviderFeatures): void { throw ni(); } $unregisterSourceControl(handle: number): void { throw ni(); } $registerGroup(sourceControlHandle: number, handle: number, id: string, label: string): void { throw ni(); } $updateGroup(sourceControlHandle: number, handle: number, features: SCMGroupFeatures): void { throw ni(); } $updateGroupResourceStates(sourceControlHandle: number, groupHandle: number, resources: SCMRawResource[]): void { throw ni(); } $unregisterGroup(sourceControlHandle: number, handle: number): void { throw ni(); } $setInputBoxValue(value: string): void { throw ni(); } } // -- extension host export abstract class ExtHostCommandsShape { $executeContributedCommand<T>(id: string, ...args: any[]): Thenable<T> { throw ni(); } $getContributedCommandHandlerDescriptions(): TPromise<{ [id: string]: string | ICommandHandlerDescription }> { throw ni(); } } export abstract class ExtHostConfigurationShape { $acceptConfigurationChanged(values: IWorkspaceConfigurationValues) { throw ni(); } } export abstract class ExtHostDiagnosticsShape { } export interface IModelAddedData { url: URI; versionId: number; lines: string[]; EOL: string; modeId: string; isDirty: boolean; } export abstract class ExtHostDocumentsShape { $provideTextDocumentContent(handle: number, uri: URI): TPromise<string> { throw ni(); } $acceptModelModeChanged(strURL: string, oldModeId: string, newModeId: string): void { throw ni(); } $acceptModelSaved(strURL: string): void { throw ni(); } $acceptModelDirty(strURL: string): void { throw ni(); } $acceptModelReverted(strURL: string): void { throw ni(); } $acceptModelChanged(strURL: string, e: IModelChangedEvent, isDirty: boolean): void { throw ni(); } } export abstract class ExtHostDocumentSaveParticipantShape { $participateInSave(resource: URI, reason: SaveReason): TPromise<boolean[]> { throw ni(); } } export interface ITextEditorAddData { id: string; document: URI; options: IResolvedTextEditorConfiguration; selections: editorCommon.ISelection[]; editorPosition: EditorPosition; } export interface ITextEditorPositionData { [id: string]: EditorPosition; } export abstract class ExtHostEditorsShape { $acceptOptionsChanged(id: string, opts: IResolvedTextEditorConfiguration): void { throw ni(); } $acceptSelectionsChanged(id: string, event: ISelectionChangeEvent): void { throw ni(); } $acceptEditorPositionData(data: ITextEditorPositionData): void { throw ni(); } } export interface IDocumentsAndEditorsDelta { removedDocuments?: string[]; addedDocuments?: IModelAddedData[]; removedEditors?: string[]; addedEditors?: ITextEditorAddData[]; newActiveEditor?: string; } export abstract class ExtHostDocumentsAndEditorsShape { $acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void { throw ni(); } } export abstract class ExtHostTreeExplorersShape { $provideRootNode(providerId: string): TPromise<InternalTreeExplorerNodeContent> { throw ni(); }; $resolveChildren(providerId: string, node: InternalTreeExplorerNodeContent): TPromise<InternalTreeExplorerNodeContent[]> { throw ni(); } $getInternalCommand(providerId: string, node: InternalTreeExplorerNodeContent): TPromise<modes.Command> { throw ni(); } } export abstract class ExtHostExtensionServiceShape { $localShowMessage(severity: Severity, msg: string): void { throw ni(); } $activateExtension(extensionDescription: IExtensionDescription): TPromise<void> { throw ni(); } } export interface FileSystemEvents { created: URI[]; changed: URI[]; deleted: URI[]; } export abstract class ExtHostFileSystemEventServiceShape { $onFileEvent(events: FileSystemEvents) { throw ni(); } } export interface ObjectIdentifier { $ident: number; } export namespace ObjectIdentifier { export const name = '$ident'; export function mixin<T>(obj: T, id: number): T & ObjectIdentifier { Object.defineProperty(obj, name, { value: id, enumerable: true }); return <T & ObjectIdentifier>obj; } export function of(obj: any): number { return obj[name]; } } export abstract class ExtHostHeapServiceShape { $onGarbageCollection(ids: number[]): void { throw ni(); } } export abstract class ExtHostLanguageFeaturesShape { $provideDocumentSymbols(handle: number, resource: URI): TPromise<modes.SymbolInformation[]> { throw ni(); } $provideCodeLenses(handle: number, resource: URI): TPromise<modes.ICodeLensSymbol[]> { throw ni(); } $resolveCodeLens(handle: number, resource: URI, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol> { throw ni(); } $provideDefinition(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.Definition> { throw ni(); } $provideImplementation(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.Definition> { throw ni(); } $provideTypeDefinition(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.Definition> { throw ni(); } $provideHover(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.Hover> { throw ni(); } $provideDocumentHighlights(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.DocumentHighlight[]> { throw ni(); } $provideReferences(handle: number, resource: URI, position: editorCommon.IPosition, context: modes.ReferenceContext): TPromise<modes.Location[]> { throw ni(); } $provideCodeActions(handle: number, resource: URI, range: editorCommon.IRange): TPromise<modes.CodeAction[]> { throw ni(); } $provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); } $provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: editorCommon.IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); } $provideOnTypeFormattingEdits(handle: number, resource: URI, position: editorCommon.IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); } $provideWorkspaceSymbols(handle: number, search: string): TPromise<modes.SymbolInformation[]> { throw ni(); } $resolveWorkspaceSymbol(handle: number, symbol: modes.SymbolInformation): TPromise<modes.SymbolInformation> { throw ni(); } $provideRenameEdits(handle: number, resource: URI, position: editorCommon.IPosition, newName: string): TPromise<modes.WorkspaceEdit> { throw ni(); } $provideCompletionItems(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.ISuggestResult> { throw ni(); } $resolveCompletionItem(handle: number, resource: URI, position: editorCommon.IPosition, suggestion: modes.ISuggestion): TPromise<modes.ISuggestion> { throw ni(); } $provideSignatureHelp(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.SignatureHelp> { throw ni(); } $provideDocumentLinks(handle: number, resource: URI): TPromise<modes.ILink[]> { throw ni(); } $resolveDocumentLink(handle: number, link: modes.ILink): TPromise<modes.ILink> { throw ni(); } } export abstract class ExtHostQuickOpenShape { $onItemSelected(handle: number): void { throw ni(); } $validateInput(input: string): TPromise<string> { throw ni(); } } export abstract class ExtHostTerminalServiceShape { $acceptTerminalClosed(id: number): void { throw ni(); } $acceptTerminalProcessId(id: number, processId: number): void { throw ni(); } $acceptTerminalData(id: number, data: string): void { throw ni(); } } export abstract class ExtHostSCMShape { $provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise<URI> { throw ni(); } $onActiveSourceControlChange(sourceControlHandle: number): TPromise<void> { throw ni(); } $onInputBoxValueChange(value: string): TPromise<void> { throw ni(); } $onInputBoxAcceptChanges(): TPromise<void> { throw ni(); } } export abstract class ExtHostTaskShape { $provideTasks(handle: number): TPromise<TaskSet> { throw ni(); } } // --- proxy identifiers export const MainContext = { MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands', MainThreadCommandsShape), MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration', MainThreadConfigurationShape), MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics', MainThreadDiagnosticsShape), MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments', MainThreadDocumentsShape), MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors', MainThreadEditorsShape), MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors', MainThreadErrorsShape), MainThreadExplorers: createMainId<MainThreadTreeExplorersShape>('MainThreadExplorers', MainThreadTreeExplorersShape), MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures', MainThreadLanguageFeaturesShape), MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages', MainThreadLanguagesShape), MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService', MainThreadMessageServiceShape), MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService', MainThreadOutputServiceShape), MainThreadProgress: createMainId<MainThreadProgressShape>('MainThreadProgress', MainThreadProgressShape), MainThreadQuickOpen: createMainId<MainThreadQuickOpenShape>('MainThreadQuickOpen', MainThreadQuickOpenShape), MainThreadStatusBar: createMainId<MainThreadStatusBarShape>('MainThreadStatusBar', MainThreadStatusBarShape), MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage', MainThreadStorageShape), MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry', MainThreadTelemetryShape), MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService', MainThreadTerminalServiceShape), MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace', MainThreadWorkspaceShape), MainProcessExtensionService: createMainId<MainProcessExtensionServiceShape>('MainProcessExtensionService', MainProcessExtensionServiceShape), MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM', MainThreadSCMShape), MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask', MainThreadTaskShape) }; export const ExtHostContext = { ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands', ExtHostCommandsShape), ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration', ExtHostConfigurationShape), ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics', ExtHostDiagnosticsShape), ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors', ExtHostDocumentsAndEditorsShape), ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments', ExtHostDocumentsShape), ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant', ExtHostDocumentSaveParticipantShape), ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ExtHostEditorsShape), ExtHostExplorers: createExtId<ExtHostTreeExplorersShape>('ExtHostExplorers', ExtHostTreeExplorersShape), ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService', ExtHostFileSystemEventServiceShape), ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor', ExtHostHeapServiceShape), ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ExtHostLanguageFeaturesShape), ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen', ExtHostQuickOpenShape), ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService', ExtHostExtensionServiceShape), ExtHostTerminalService: createExtId<ExtHostTerminalServiceShape>('ExtHostTerminalService', ExtHostTerminalServiceShape), ExtHostSCM: createExtId<ExtHostSCMShape>('ExtHostSCM', ExtHostSCMShape), ExtHostTask: createExtId<ExtHostTaskShape>('ExtHostTask', ExtHostTaskShape) };
hashhar/vscode
src/vs/workbench/api/node/extHost.protocol.ts
TypeScript
mit
25,322
/** intersperseThunk :: ([a], (_ -> a)) -> [a] */ export const intersperseThunk = <T>(array: T[], delimiterThunk: () => T): T[] => { if (array === undefined) { throw new Error('Cannot intersperse undefined'); } if (array.length <= 1) { return array; } const r: T[] = []; r.push(array[0]); for (let i = 1; i < array.length; i++) { r.push(delimiterThunk()); r.push(array[i]); } return r; }; /** intersperse :: ([a], a) -> [a] */ export const intersperse = <T>(array: T[], delimiter: T): T[] => { const thunk = () => { return delimiter; }; return intersperseThunk(array, thunk); };
tinymce/tinymce
modules/katamari/src/main/ts/ephox/katamari/api/Jam.ts
TypeScript
mit
627
using Newtonsoft.Json; namespace GoogleApi.Entities.Places.Details.Response { /// <summary> /// Places Details Response. /// </summary> public class PlacesDetailsResponse : BasePlacesResponse { /// <summary> /// Results contains an array of places, with information about the place. /// See Place Search Results for information about these results. /// The Places API returns up to 20 establishment results. Additionally, political results may be returned which serve to identify the area of the request. /// </summary> [JsonProperty("result")] public virtual DetailsResult Result { get; set; } } }
curioswitch/curiostack
cafe-map/client/unity/Assets/ThirdParty/GoogleApi/Entities/Places/Details/Response/PlacesDetailsResponse.cs
C#
mit
684
<?php class Payfort_Pay_Block_Note extends Mage_Adminhtml_Block_System_Config_Form_Field { function _getElementHtml(Varien_Data_Form_Element_Abstract $element) { $element_id = str_replace('payment_payfort_', '', $element->getId()); switch($element_id): case 'more_info': return '<a href="http://www.payfort.com/contact-us/" target="_blank">Contact Us</a>'; break; case 'host_to_host_url': $defaultStoreId = Mage::app() ->getWebsite(true) ->getDefaultGroup() ->getDefaultStoreId(); return Mage::app()->getStore($defaultStoreId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK). 'payfort/payment/response/'; break; break; // case 'how_to_test': // return '<a href="https://secure.payfort.com/Ncol/PayFort_Testacc_EN.pdf?CSRFSP=%2fncol%2ftest%2fbackoffice%2fsupportgetdownloaddocument.asp&CSRFKEY=83E267BD93379EC7A63B9D5BDBE67B83E81240E9&CSRFTS=20130906221442&branding=PAYFORT" target="_blank">How to create a test account</a>'; // break; case 'feedback_urls': return ' Accepturl: http://[example.com]/[store lanuage code]/payfort/payment/response?response_type=accept <br /> Declineurl: http://[example.com]/[store lanuage code]/payfort/payment/response?response_type=decline <br /> Exceptionurl: http://[example.com]/[store lanuage code]/payfort/payment/response?response_type=exception <br /> Cancelurl: http://[example.com]/[store lanuage code]/payfort/payment/response?response_type=cancel <br /> '; break; endswitch; } }
DeyaZ88/magento-payfort
app/code/community/Payfort/Pay/Block/Note.php
PHP
mit
1,658
// Copyright 2015 Geofrey Ernest <[email protected]>. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // Package flash is a collection of flash messages middleware for zedlist. package flash import ( "github.com/gernest/zedlist/modules/flash" "github.com/labstack/echo" ) // Flash adds flash messages to the request context. func Flash() echo.HandlerFunc { return func(ctx *echo.Context) error { flash.AddFlashToCtx(ctx) return nil } }
dazzaji/zedlist
middlewares/flash/flash.go
GO
mit
530
--- author: Matthew Taylor brief: date: 2015/05/30 event: when: begin: 2015/05/30 10:00 end: 2015/05/31 20:00 where: desc: Cornell Tech city: New York City state: NY country: USA web: http://www.meetup.com/numenta/events/220422020/ image: ../images/image.png org: Open Source Manager tags: nupic spring 2015 hackathon numenta machine intelligence htm hierarchical temporal memory title: NuPIC Spring 2015 Hackathon NYC type: post --- ### Please RSVP on our Meetup.com page * http://www.meetup.com/numenta/events/220422020/ ### More Info * NuPIC Event Page: http://numenta.org/events/hackathon/2015/may/
lscheinkman/numenta-web
packages/numenta.com/pages/events/2015/05/30/nupic-spring-2015-hackathon.md
Markdown
mit
639
/* * Copyright (c) 2005 Mellanox Technologies. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. * * This software is available to you under the OpenIB.org BSD license * below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _GETOPT_H_ #define _GETOPT_H_ #ifdef __cplusplus extern "C" { #endif extern char *optarg; extern int optind; extern int opterr; extern int optopt; struct option { const char *name; int has_arg; int *flag; int val; }; enum { no_argument, required_argument, optional_argument }; extern int getopt(int argc, char * const argv[], char const *opts); extern int getopt_long(int argc, char * const argv[], char const *opts, const struct option *longopts, int *longindex); #ifdef __cplusplus } // extern "C" #endif #endif
dismalion/oooii
Ouroboros/External/OFED_SDK/Inc/getopt.h
C
mit
1,902
Prism.languages.autoit = { 'comment': [ /;.*/, { // The multi-line comments delimiters can actually be commented out with ";" pattern: /(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:ce|comments-end)/m, lookbehind: true } ], 'url': { pattern: /(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m, lookbehind: true }, 'string': { pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/, greedy: true, inside: { 'variable': /([%$@])\w+\1/ } }, 'directive': { pattern: /(^[\t ]*)#[\w-]+/m, lookbehind: true, alias: 'keyword' }, 'function': /\b\w+(?=\()/, // Variables and macros 'variable': /[$@]\w+/, 'keyword': /\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i, 'number': /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i, 'boolean': /\b(?:False|True)\b/i, 'operator': /<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Not|Or)\b/i, 'punctuation': /[\[\]().,:]/ };
PrismJS/prism
components/prism-autoit.js
JavaScript
mit
1,071
<?php /* * This file is part of the PHPExifTool package. * * (c) Alchemy <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\FujiFilm; use JMS\Serializer\Annotation\ExclusionPolicy; use PHPExiftool\Driver\AbstractTag; /** * @ExclusionPolicy("all") */ class InternalSerialNumber extends AbstractTag { protected $Id = 16; protected $Name = 'InternalSerialNumber'; protected $FullName = 'FujiFilm::Main'; protected $GroupName = 'FujiFilm'; protected $g0 = 'MakerNotes'; protected $g1 = 'FujiFilm'; protected $g2 = 'Camera'; protected $Type = 'string'; protected $Writable = true; protected $Description = 'Internal Serial Number'; protected $flag_Permanent = true; }
bburnichon/PHPExiftool
lib/PHPExiftool/Driver/Tag/FujiFilm/InternalSerialNumber.php
PHP
mit
865
require File.expand_path '../../test_helper', __dir__ # Test class for Check Network Security Rule Exists class TestCheckNetworkSecurityRuleExists < Minitest::Test def setup @service = Fog::Network::AzureRM.new(credentials) @client = @service.instance_variable_get(:@network_client) @network_security_rules = @client.security_rules end def test_check_net_sec_rule_exists_success mocked_response = ApiStub::Requests::Network::NetworkSecurityRule.create_network_security_rule_response(@client) @network_security_rules.stub :get, mocked_response do assert @service.check_net_sec_rule_exists('fog-test-rg', 'fog-test-nsg', 'fog-test-nsr') end end def test_check_net_sec_rule_exists_failure response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) } @network_security_rules.stub :get, response do assert [email protected]_net_sec_rule_exists('fog-test-rg', 'fog-test-nsg', 'fog-test-nsr') end end def test_check_net_sec_rule_resource_group_exists_failure response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) } @network_security_rules.stub :get, response do assert [email protected]_net_sec_rule_exists('fog-test-rg', 'fog-test-nsg', 'fog-test-nsr') end end def test_check_net_sec_rule_exists_exception response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) } @network_security_rules.stub :get, response do assert_raises(MsRestAzure::AzureOperationError) { @service.check_net_sec_rule_exists('fog-test-rg', 'fog-test-nsg', 'fog-test-nsr') } end end end
fog/fog-azure-rm
test/requests/network/test_check_net_sec_rule_exists.rb
Ruby
mit
1,883
<h1>Error 500</h1> <p class="lead"> There was an error trying to communicate with the Bullshit Stock Exchange server. Please try again later. </p> <p class="lead"> <a href="/home">Proceed to the homepage</a> </p>
lawsmith/comp4711-StockGame
application/views/Error_500.php
PHP
mit
216
'use strict'; /** * Module dependencies. */ var utils = require('../../../../common/utils'), Abstract = require('../../../event/notifier/abstract') ; /** * Expose `Command`. */ module.exports = Command; /** * Initialize a new command notifier. */ function Command() { Abstract.call(this); } utils.extend(Abstract, Command); Command.defineDependency('_logger', 'danf:logging.logger'); /** * Logger. * * @var {danf:logging.logger} * @api public */ Object.defineProperty(Command.prototype, 'logger', { set: function(logger) { this._logger = logger; } }); /** * @interface {danf:event.notifier} */ Object.defineProperty(Command.prototype, 'name', { value: 'command' }); /** * @interface {danf:event.notifier} */ Object.defineProperty(Command.prototype, 'contract', { get: function () { return { options: { type: 'object', validate: function(value) { if (undefined === value._) { value._ = { type: 'string_array', default: [] } } } }, aliases: { type: 'string_object', default: {}, validate: function (value) { for (var key in value) { if (key.length >= 2) { throw new Error('a string object with aliases of one character as key and option name as value'); } } } } }; } }); /** * @inheritdoc */ Command.prototype.getEventDataContract = function(event) { return null; } /** * @inheritdoc */ Command.prototype.notifyEvent = function(name, parameters, sequence, data, meta) { var self = this, errored = false, callback = data.callback, handleErrors = function(errors) { var error; if (1 === errors.length) { error = errors[0]; } else { error = new Error(''); error.embedded = []; } self._logger.log( '<<error>><<bold>>Command "{0}" processing failed.'.format( name ), 1 ); var messages = []; for (var i = 0; i < errors.length; i++) { self._logger.log('<<error>>{0}'.format(errors[i].message), 1); self._logger.log( '<<grey>>{0}'.format( errors[i].stack.replace(errors[i].message, '') ), 2, 1, 0 ); messages.push(errors[i].message); if (1 !== errors.length) { error.embedded.push(errors[i]) } } if (1 !== errors.length) { error.message = messages.join('; '); } errored = true; if (callback) { callback(error); } } ; delete data.callback; try { if (parameters.options) { data = this._dataResolver.resolve( data, parameters.options, 'command[{0}].data'.format(name) ); } sequence.execute(data, {}, '.', handleErrors, function() { if (callback && !errored) { callback(); } }); } catch (error) { handleErrors([error]); } }
Gnucki/danf
lib/common/command/event/notifier/command.js
JavaScript
mit
3,680
/* * Encog(tm) Core v3.2 - Java Version * http://www.heatonresearch.com/encog/ * https://github.com/encog/encog-java-core * Copyright 2008-2013 Heaton Research, Inc. * * 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. * * For more information on Heaton Research copyrights, licenses * and trademarks visit: * http://www.heatonresearch.com/copyright */ package org.encog.ensemble; import org.encog.ensemble.data.EnsembleDataSet; import org.encog.ml.MLClassification; import org.encog.ml.MLMethod; import org.encog.ml.MLRegression; import org.encog.ml.train.MLTrain; /** * @author nitbix * */ public interface EnsembleML extends MLMethod, MLClassification, MLRegression { /** * Set the dataset for this member * <p/> * @param dataSet The data set. */ public void setTrainingSet(EnsembleDataSet dataSet); /** * Set the training for this member * <p/> * @param train The trainer. */ public void setTraining(MLTrain train); /** * @return Get the dataset for this member */ public EnsembleDataSet getTrainingSet(); /** * @return Get the dataset for this member. */ public MLTrain getTraining(); /** * Train the ML to a certain accuracy. * <p/> * @param targetError The target error. */ public void train(double targetError); /** * Train the ML to a certain accuracy. * <p/> * @param targetError Target error. * @param verbose Verbose mode. */ public void train(double targetError, boolean verbose); /** * Get the error for this ML on the dataset */ public double getError(EnsembleDataSet testset); /** * Set the MLMethod to run * <p/> * @param newMl The new ML. */ public void setMl(MLMethod newMl); /** * @return Returns the current MLMethod */ public MLMethod getMl(); public void trainStep(); public String getLabel(); }
ladygagapowerbot/bachelor-thesis-implementation
lib/Encog/src/main/java/org/encog/ensemble/EnsembleML.java
Java
mit
2,479
--- title: Lupausten Varassa Lepääminen date: 17/06/2021 --- Kuuluisasta kardinaali Bellarminosta, suuresta katolilaisesta kristinuskon puolustajasta, joka taisteli koko ikänsä sitä vastaan, että hyväksemme luettu vanhurskaus tulee yksin uskosta, kerrotaan seuraavaa tarinaa. Bellarminon maatessa kuolinvuoteellaan hänelle tuotiin krusifikseja ja hänele tarjottiin pyhien ansioita, jotta hän saisi rauhan ennen kuolemaansa. Bellarmino sanoi kuitenkin: ”Viekää nuo pois. Mielestäni on turvallisempaa luottaa Kristuksen ansioihin.” Lähestyessään elämänsä loppua monet katsovat taakseen ja näkevät, kuinka turhia ja hyödyttömiä heidän tekonsa ja ansionsa ovat. Ei niillä ansaita pelastusta pyhän Jumalan edessä. He tajuavat, kuinka paljon he tarvitsevat Kristuksen vanhurskautta. Hyvä uutinen on se, että meidän ei tarvitse odottaa lähestyvää kuolemaa saadaksemme varmuutta Herrassa. Koko liitto perustuu Jumalan varmoihin lupauksiin tässä ja nyt. Lupaukset ovat käytössämme välittömästi – lupaukset, jotka voivat tehdä elämästämme paremman jo nyt. Etsi seuraavat jakeet ja vastaa niihin liittyviin kysymyksiin siitä näkökulmasta, miten voit säilyttää, kehittää ja vahvistaa liittosuhdettasi Jumalan kanssa. `Ps. 34:9 (Miten voit maistaa Jumalan hyvyyttä?)` `Matt. 11:30 (Mikä siinä, mitä Kristus on tehnyt hyväksemme, tekee ikeestä hyvän kantaa?)` `Room. 5:1 (Miten vanhurskauttaminen liittyy rauhaan?)` `Fil. 2:7, 8 (Mitä olet saanut omaksesi Kristuksen alentumisen ansiosta?)` `Tutki rukoillen elämääsi ja kysy itseltäsi, mitä sellaisia asioita teen, jotka vahvistavat suhdettani Jumalaan, ja mitä sellaisia, jotka heikentävät sitä? Mitä muutoksia minun pitäisi tehdä?`
imasaru/sabbath-school-lessons
src/fi/2021-02/12/06.md
Markdown
mit
1,760
# frozen_string_literal: true require "active_support/core_ext/hash/indifferent_access" require "active_support/core_ext/array/wrap" require "active_support/core_ext/string/filters" require "active_support/core_ext/object/to_query" require "action_dispatch/http/upload" require "rack/test" require "stringio" require "set" require "yaml" module ActionController # Raised when a required parameter is missing. # # params = ActionController::Parameters.new(a: {}) # params.fetch(:b) # # => ActionController::ParameterMissing: param is missing or the value is empty: b # params.require(:a) # # => ActionController::ParameterMissing: param is missing or the value is empty: a class ParameterMissing < KeyError attr_reader :param # :nodoc: def initialize(param) # :nodoc: @param = param super("param is missing or the value is empty: #{param}") end end # Raised when a supplied parameter is not expected and # ActionController::Parameters.action_on_unpermitted_parameters # is set to <tt>:raise</tt>. # # params = ActionController::Parameters.new(a: "123", b: "456") # params.permit(:c) # # => ActionController::UnpermittedParameters: found unpermitted parameters: :a, :b class UnpermittedParameters < IndexError attr_reader :params # :nodoc: def initialize(params) # :nodoc: @params = params super("found unpermitted parameter#{'s' if params.size > 1 }: #{params.map { |e| ":#{e}" }.join(", ")}") end end # Raised when a Parameters instance is not marked as permitted and # an operation to transform it to hash is called. # # params = ActionController::Parameters.new(a: "123", b: "456") # params.to_h # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash class UnfilteredParameters < ArgumentError def initialize # :nodoc: super("unable to convert unpermitted parameters to hash") end end # == Action Controller \Parameters # # Allows you to choose which attributes should be permitted for mass updating # and thus prevent accidentally exposing that which shouldn't be exposed. # Provides two methods for this purpose: #require and #permit. The former is # used to mark parameters as required. The latter is used to set the parameter # as permitted and limit which attributes should be allowed for mass updating. # # params = ActionController::Parameters.new({ # person: { # name: "Francesco", # age: 22, # role: "admin" # } # }) # # permitted = params.require(:person).permit(:name, :age) # permitted # => <ActionController::Parameters {"name"=>"Francesco", "age"=>22} permitted: true> # permitted.permitted? # => true # # Person.first.update!(permitted) # # => #<Person id: 1, name: "Francesco", age: 22, role: "user"> # # It provides two options that controls the top-level behavior of new instances: # # * +permit_all_parameters+ - If it's +true+, all the parameters will be # permitted by default. The default is +false+. # * +action_on_unpermitted_parameters+ - Allow to control the behavior when parameters # that are not explicitly permitted are found. The values can be +false+ to just filter them # out, <tt>:log</tt> to additionally write a message on the logger, or <tt>:raise</tt> to raise # ActionController::UnpermittedParameters exception. The default value is <tt>:log</tt> # in test and development environments, +false+ otherwise. # # Examples: # # params = ActionController::Parameters.new # params.permitted? # => false # # ActionController::Parameters.permit_all_parameters = true # # params = ActionController::Parameters.new # params.permitted? # => true # # params = ActionController::Parameters.new(a: "123", b: "456") # params.permit(:c) # # => <ActionController::Parameters {} permitted: true> # # ActionController::Parameters.action_on_unpermitted_parameters = :raise # # params = ActionController::Parameters.new(a: "123", b: "456") # params.permit(:c) # # => ActionController::UnpermittedParameters: found unpermitted keys: a, b # # Please note that these options *are not thread-safe*. In a multi-threaded # environment they should only be set once at boot-time and never mutated at # runtime. # # You can fetch values of <tt>ActionController::Parameters</tt> using either # <tt>:key</tt> or <tt>"key"</tt>. # # params = ActionController::Parameters.new(key: "value") # params[:key] # => "value" # params["key"] # => "value" class Parameters cattr_accessor :permit_all_parameters, instance_accessor: false, default: false cattr_accessor :action_on_unpermitted_parameters, instance_accessor: false ## # :method: as_json # # :call-seq: # as_json(options=nil) # # Returns a hash that can be used as the JSON representation for the parameters. ## # :method: each_key # # :call-seq: # each_key() # # Calls block once for each key in the parameters, passing the key. # If no block is given, an enumerator is returned instead. ## # :method: empty? # # :call-seq: # empty?() # # Returns true if the parameters have no key/value pairs. ## # :method: has_key? # # :call-seq: # has_key?(key) # # Returns true if the given key is present in the parameters. ## # :method: has_value? # # :call-seq: # has_value?(value) # # Returns true if the given value is present for some key in the parameters. ## # :method: include? # # :call-seq: # include?(key) # # Returns true if the given key is present in the parameters. ## # :method: key? # # :call-seq: # key?(key) # # Returns true if the given key is present in the parameters. ## # :method: keys # # :call-seq: # keys() # # Returns a new array of the keys of the parameters. ## # :method: to_s # # :call-seq: # to_s() # # Returns the content of the parameters as a string. ## # :method: value? # # :call-seq: # value?(value) # # Returns true if the given value is present for some key in the parameters. ## # :method: values # # :call-seq: # values() # # Returns a new array of the values of the parameters. delegate :keys, :key?, :has_key?, :values, :has_value?, :value?, :empty?, :include?, :as_json, :to_s, :each_key, to: :@parameters # By default, never raise an UnpermittedParameters exception if these # params are present. The default includes both 'controller' and 'action' # because they are added by Rails and should be of no concern. One way # to change these is to specify `always_permitted_parameters` in your # config. For instance: # # config.always_permitted_parameters = %w( controller action format ) cattr_accessor :always_permitted_parameters, default: %w( controller action ) class << self def nested_attribute?(key, value) # :nodoc: /\A-?\d+\z/.match?(key) && (value.is_a?(Hash) || value.is_a?(Parameters)) end end # Returns a new instance of <tt>ActionController::Parameters</tt>. # Also, sets the +permitted+ attribute to the default value of # <tt>ActionController::Parameters.permit_all_parameters</tt>. # # class Person < ActiveRecord::Base # end # # params = ActionController::Parameters.new(name: "Francesco") # params.permitted? # => false # Person.new(params) # => ActiveModel::ForbiddenAttributesError # # ActionController::Parameters.permit_all_parameters = true # # params = ActionController::Parameters.new(name: "Francesco") # params.permitted? # => true # Person.new(params) # => #<Person id: nil, name: "Francesco"> def initialize(parameters = {}) @parameters = parameters.with_indifferent_access @permitted = self.class.permit_all_parameters end # Returns true if another +Parameters+ object contains the same content and # permitted flag. def ==(other) if other.respond_to?(:permitted?) permitted? == other.permitted? && parameters == other.parameters else @parameters == other end end alias eql? == def hash [@parameters.hash, @permitted].hash end # Returns a safe <tt>ActiveSupport::HashWithIndifferentAccess</tt> # representation of the parameters with all unpermitted keys removed. # # params = ActionController::Parameters.new({ # name: "Senjougahara Hitagi", # oddity: "Heavy stone crab" # }) # params.to_h # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash # # safe_params = params.permit(:name) # safe_params.to_h # => {"name"=>"Senjougahara Hitagi"} def to_h if permitted? convert_parameters_to_hashes(@parameters, :to_h) else raise UnfilteredParameters end end # Returns a safe <tt>Hash</tt> representation of the parameters # with all unpermitted keys removed. # # params = ActionController::Parameters.new({ # name: "Senjougahara Hitagi", # oddity: "Heavy stone crab" # }) # params.to_hash # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash # # safe_params = params.permit(:name) # safe_params.to_hash # => {"name"=>"Senjougahara Hitagi"} def to_hash to_h.to_hash end # Returns a string representation of the receiver suitable for use as a URL # query string: # # params = ActionController::Parameters.new({ # name: "David", # nationality: "Danish" # }) # params.to_query # # => ActionController::UnfilteredParameters: unable to convert unpermitted parameters to hash # # safe_params = params.permit(:name, :nationality) # safe_params.to_query # # => "name=David&nationality=Danish" # # An optional namespace can be passed to enclose key names: # # params = ActionController::Parameters.new({ # name: "David", # nationality: "Danish" # }) # safe_params = params.permit(:name, :nationality) # safe_params.to_query("user") # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish" # # The string pairs "key=value" that conform the query string # are sorted lexicographically in ascending order. # # This method is also aliased as +to_param+. def to_query(*args) to_h.to_query(*args) end alias_method :to_param, :to_query # Returns an unsafe, unfiltered # <tt>ActiveSupport::HashWithIndifferentAccess</tt> representation of the # parameters. # # params = ActionController::Parameters.new({ # name: "Senjougahara Hitagi", # oddity: "Heavy stone crab" # }) # params.to_unsafe_h # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} def to_unsafe_h convert_parameters_to_hashes(@parameters, :to_unsafe_h) end alias_method :to_unsafe_hash, :to_unsafe_h # Convert all hashes in values into parameters, then yield each pair in # the same way as <tt>Hash#each_pair</tt>. def each_pair(&block) @parameters.each_pair do |key, value| yield [key, convert_hashes_to_parameters(key, value)] end end alias_method :each, :each_pair # Convert all hashes in values into parameters, then yield each value in # the same way as <tt>Hash#each_value</tt>. def each_value(&block) @parameters.each_pair do |key, value| yield convert_hashes_to_parameters(key, value) end end # Attribute that keeps track of converted arrays, if any, to avoid double # looping in the common use case permit + mass-assignment. Defined in a # method to instantiate it only if needed. # # Testing membership still loops, but it's going to be faster than our own # loop that converts values. Also, we are not going to build a new array # object per fetch. def converted_arrays @converted_arrays ||= Set.new end # Returns +true+ if the parameter is permitted, +false+ otherwise. # # params = ActionController::Parameters.new # params.permitted? # => false # params.permit! # params.permitted? # => true def permitted? @permitted end # Sets the +permitted+ attribute to +true+. This can be used to pass # mass assignment. Returns +self+. # # class Person < ActiveRecord::Base # end # # params = ActionController::Parameters.new(name: "Francesco") # params.permitted? # => false # Person.new(params) # => ActiveModel::ForbiddenAttributesError # params.permit! # params.permitted? # => true # Person.new(params) # => #<Person id: nil, name: "Francesco"> def permit! each_pair do |key, value| Array.wrap(value).flatten.each do |v| v.permit! if v.respond_to? :permit! end end @permitted = true self end # This method accepts both a single key and an array of keys. # # When passed a single key, if it exists and its associated value is # either present or the singleton +false+, returns said value: # # ActionController::Parameters.new(person: { name: "Francesco" }).require(:person) # # => <ActionController::Parameters {"name"=>"Francesco"} permitted: false> # # Otherwise raises <tt>ActionController::ParameterMissing</tt>: # # ActionController::Parameters.new.require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # ActionController::Parameters.new(person: nil).require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # ActionController::Parameters.new(person: "\t").require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # ActionController::Parameters.new(person: {}).require(:person) # # ActionController::ParameterMissing: param is missing or the value is empty: person # # When given an array of keys, the method tries to require each one of them # in order. If it succeeds, an array with the respective return values is # returned: # # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) # user_params, profile_params = params.require([:user, :profile]) # # Otherwise, the method re-raises the first exception found: # # params = ActionController::Parameters.new(user: {}, profile: {}) # user_params, profile_params = params.require([:user, :profile]) # # ActionController::ParameterMissing: param is missing or the value is empty: user # # Technically this method can be used to fetch terminal values: # # # CAREFUL # params = ActionController::Parameters.new(person: { name: "Finn" }) # name = params.require(:person).require(:name) # CAREFUL # # but take into account that at some point those ones have to be permitted: # # def person_params # params.require(:person).permit(:name).tap do |person_params| # person_params.require(:name) # SAFER # end # end # # for example. def require(key) return key.map { |k| require(k) } if key.is_a?(Array) value = self[key] if value.present? || value == false value else raise ParameterMissing.new(key) end end # Alias of #require. alias :required :require # Returns a new <tt>ActionController::Parameters</tt> instance that # includes only the given +filters+ and sets the +permitted+ attribute # for the object to +true+. This is useful for limiting which attributes # should be allowed for mass updating. # # params = ActionController::Parameters.new(user: { name: "Francesco", age: 22, role: "admin" }) # permitted = params.require(:user).permit(:name, :age) # permitted.permitted? # => true # permitted.has_key?(:name) # => true # permitted.has_key?(:age) # => true # permitted.has_key?(:role) # => false # # Only permitted scalars pass the filter. For example, given # # params.permit(:name) # # +:name+ passes if it is a key of +params+ whose associated value is of type # +String+, +Symbol+, +NilClass+, +Numeric+, +TrueClass+, +FalseClass+, # +Date+, +Time+, +DateTime+, +StringIO+, +IO+, # +ActionDispatch::Http::UploadedFile+ or +Rack::Test::UploadedFile+. # Otherwise, the key +:name+ is filtered out. # # You may declare that the parameter should be an array of permitted scalars # by mapping it to an empty array: # # params = ActionController::Parameters.new(tags: ["rails", "parameters"]) # params.permit(tags: []) # # Sometimes it is not possible or convenient to declare the valid keys of # a hash parameter or its internal structure. Just map to an empty hash: # # params.permit(preferences: {}) # # Be careful because this opens the door to arbitrary input. In this # case, +permit+ ensures values in the returned structure are permitted # scalars and filters out anything else. # # You can also use +permit+ on nested parameters, like: # # params = ActionController::Parameters.new({ # person: { # name: "Francesco", # age: 22, # pets: [{ # name: "Purplish", # category: "dogs" # }] # } # }) # # permitted = params.permit(person: [ :name, { pets: :name } ]) # permitted.permitted? # => true # permitted[:person][:name] # => "Francesco" # permitted[:person][:age] # => nil # permitted[:person][:pets][0][:name] # => "Purplish" # permitted[:person][:pets][0][:category] # => nil # # Note that if you use +permit+ in a key that points to a hash, # it won't allow all the hash. You also need to specify which # attributes inside the hash should be permitted. # # params = ActionController::Parameters.new({ # person: { # contact: { # email: "[email protected]", # phone: "555-1234" # } # } # }) # # params.require(:person).permit(:contact) # # => <ActionController::Parameters {} permitted: true> # # params.require(:person).permit(contact: :phone) # # => <ActionController::Parameters {"contact"=><ActionController::Parameters {"phone"=>"555-1234"} permitted: true>} permitted: true> # # params.require(:person).permit(contact: [ :email, :phone ]) # # => <ActionController::Parameters {"contact"=><ActionController::Parameters {"email"=>"[email protected]", "phone"=>"555-1234"} permitted: true>} permitted: true> def permit(*filters) params = self.class.new filters.flatten.each do |filter| case filter when Symbol, String permitted_scalar_filter(params, filter) when Hash hash_filter(params, filter) end end unpermitted_parameters!(params) if self.class.action_on_unpermitted_parameters params.permit! end # Returns a parameter for the given +key+. If not found, # returns +nil+. # # params = ActionController::Parameters.new(person: { name: "Francesco" }) # params[:person] # => <ActionController::Parameters {"name"=>"Francesco"} permitted: false> # params[:none] # => nil def [](key) convert_hashes_to_parameters(key, @parameters[key]) end # Assigns a value to a given +key+. The given key may still get filtered out # when +permit+ is called. def []=(key, value) @parameters[key] = value end # Returns a parameter for the given +key+. If the +key+ # can't be found, there are several options: With no other arguments, # it will raise an <tt>ActionController::ParameterMissing</tt> error; # if a second argument is given, then that is returned (converted to an # instance of ActionController::Parameters if possible); if a block # is given, then that will be run and its result returned. # # params = ActionController::Parameters.new(person: { name: "Francesco" }) # params.fetch(:person) # => <ActionController::Parameters {"name"=>"Francesco"} permitted: false> # params.fetch(:none) # => ActionController::ParameterMissing: param is missing or the value is empty: none # params.fetch(:none, {}) # => <ActionController::Parameters {} permitted: false> # params.fetch(:none, "Francesco") # => "Francesco" # params.fetch(:none) { "Francesco" } # => "Francesco" def fetch(key, *args) convert_value_to_parameters( @parameters.fetch(key) { if block_given? yield else args.fetch(0) { raise ActionController::ParameterMissing.new(key) } end } ) end # Extracts the nested parameter from the given +keys+ by calling +dig+ # at each step. Returns +nil+ if any intermediate step is +nil+. # # params = ActionController::Parameters.new(foo: { bar: { baz: 1 } }) # params.dig(:foo, :bar, :baz) # => 1 # params.dig(:foo, :zot, :xyz) # => nil # # params2 = ActionController::Parameters.new(foo: [10, 11, 12]) # params2.dig(:foo, 1) # => 11 def dig(*keys) convert_hashes_to_parameters(keys.first, @parameters[keys.first]) @parameters.dig(*keys) end # Returns a new <tt>ActionController::Parameters</tt> instance that # includes only the given +keys+. If the given +keys+ # don't exist, returns an empty hash. # # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) # params.slice(:a, :b) # => <ActionController::Parameters {"a"=>1, "b"=>2} permitted: false> # params.slice(:d) # => <ActionController::Parameters {} permitted: false> def slice(*keys) new_instance_with_inherited_permitted_status(@parameters.slice(*keys)) end # Returns current <tt>ActionController::Parameters</tt> instance which # contains only the given +keys+. def slice!(*keys) @parameters.slice!(*keys) self end # Returns a new <tt>ActionController::Parameters</tt> instance that # filters out the given +keys+. # # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) # params.except(:a, :b) # => <ActionController::Parameters {"c"=>3} permitted: false> # params.except(:d) # => <ActionController::Parameters {"a"=>1, "b"=>2, "c"=>3} permitted: false> def except(*keys) new_instance_with_inherited_permitted_status(@parameters.except(*keys)) end # Removes and returns the key/value pairs matching the given keys. # # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) # params.extract!(:a, :b) # => <ActionController::Parameters {"a"=>1, "b"=>2} permitted: false> # params # => <ActionController::Parameters {"c"=>3} permitted: false> def extract!(*keys) new_instance_with_inherited_permitted_status(@parameters.extract!(*keys)) end # Returns a new <tt>ActionController::Parameters</tt> with the results of # running +block+ once for every value. The keys are unchanged. # # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) # params.transform_values { |x| x * 2 } # # => <ActionController::Parameters {"a"=>2, "b"=>4, "c"=>6} permitted: false> def transform_values return to_enum(:transform_values) unless block_given? new_instance_with_inherited_permitted_status( @parameters.transform_values { |v| yield convert_value_to_parameters(v) } ) end # Performs values transformation and returns the altered # <tt>ActionController::Parameters</tt> instance. def transform_values! return to_enum(:transform_values!) unless block_given? @parameters.transform_values! { |v| yield convert_value_to_parameters(v) } self end # Returns a new <tt>ActionController::Parameters</tt> instance with the # results of running +block+ once for every key. The values are unchanged. def transform_keys(&block) return to_enum(:transform_keys) unless block_given? new_instance_with_inherited_permitted_status( @parameters.transform_keys(&block) ) end # Performs keys transformation and returns the altered # <tt>ActionController::Parameters</tt> instance. def transform_keys!(&block) return to_enum(:transform_keys!) unless block_given? @parameters.transform_keys!(&block) self end # Returns a new <tt>ActionController::Parameters</tt> instance with the # results of running +block+ once for every key. This includes the keys # from the root hash and from all nested hashes and arrays. The values are unchanged. def deep_transform_keys(&block) new_instance_with_inherited_permitted_status( @parameters.deep_transform_keys(&block) ) end # Returns the <tt>ActionController::Parameters</tt> instance changing its keys. # This includes the keys from the root hash and from all nested hashes and arrays. # The values are unchanged. def deep_transform_keys!(&block) @parameters.deep_transform_keys!(&block) self end # Deletes a key-value pair from +Parameters+ and returns the value. If # +key+ is not found, returns +nil+ (or, with optional code block, yields # +key+ and returns the result). Cf. +#extract!+, which returns the # corresponding +ActionController::Parameters+ object. def delete(key, &block) convert_value_to_parameters(@parameters.delete(key, &block)) end # Returns a new instance of <tt>ActionController::Parameters</tt> with only # items that the block evaluates to true. def select(&block) new_instance_with_inherited_permitted_status(@parameters.select(&block)) end # Equivalent to Hash#keep_if, but returns +nil+ if no changes were made. def select!(&block) @parameters.select!(&block) self end alias_method :keep_if, :select! # Returns a new instance of <tt>ActionController::Parameters</tt> with items # that the block evaluates to true removed. def reject(&block) new_instance_with_inherited_permitted_status(@parameters.reject(&block)) end # Removes items that the block evaluates to true and returns self. def reject!(&block) @parameters.reject!(&block) self end alias_method :delete_if, :reject! # Returns a new instance of <tt>ActionController::Parameters</tt> without the blank values. # Uses Object#blank? for determining if a value is blank. def compact_blank reject { |_k, v| v.blank? } end # Removes all blank values in place and returns self. # Uses Object#blank? for determining if a value is blank. def compact_blank! reject! { |_k, v| v.blank? } end # Returns values that were assigned to the given +keys+. Note that all the # +Hash+ objects will be converted to <tt>ActionController::Parameters</tt>. def values_at(*keys) convert_value_to_parameters(@parameters.values_at(*keys)) end # Returns a new <tt>ActionController::Parameters</tt> with all keys from # +other_hash+ merged into current hash. def merge(other_hash) new_instance_with_inherited_permitted_status( @parameters.merge(other_hash.to_h) ) end # Returns current <tt>ActionController::Parameters</tt> instance with # +other_hash+ merged into current hash. def merge!(other_hash) @parameters.merge!(other_hash.to_h) self end # Returns a new <tt>ActionController::Parameters</tt> with all keys from # current hash merged into +other_hash+. def reverse_merge(other_hash) new_instance_with_inherited_permitted_status( other_hash.to_h.merge(@parameters) ) end alias_method :with_defaults, :reverse_merge # Returns current <tt>ActionController::Parameters</tt> instance with # current hash merged into +other_hash+. def reverse_merge!(other_hash) @parameters.merge!(other_hash.to_h) { |key, left, right| left } self end alias_method :with_defaults!, :reverse_merge! # This is required by ActiveModel attribute assignment, so that user can # pass +Parameters+ to a mass assignment methods in a model. It should not # matter as we are using +HashWithIndifferentAccess+ internally. def stringify_keys # :nodoc: dup end def inspect "<#{self.class} #{@parameters} permitted: #{@permitted}>" end def self.hook_into_yaml_loading # :nodoc: # Wire up YAML format compatibility with Rails 4.2 and Psych 2.0.8 and 2.0.9+. # Makes the YAML parser call `init_with` when it encounters the keys below # instead of trying its own parsing routines. YAML.load_tags["!ruby/hash-with-ivars:ActionController::Parameters"] = name YAML.load_tags["!ruby/hash:ActionController::Parameters"] = name end hook_into_yaml_loading def init_with(coder) # :nodoc: case coder.tag when "!ruby/hash:ActionController::Parameters" # YAML 2.0.8's format where hash instance variables weren't stored. @parameters = coder.map.with_indifferent_access @permitted = false when "!ruby/hash-with-ivars:ActionController::Parameters" # YAML 2.0.9's Hash subclass format where keys and values # were stored under an elements hash and `permitted` within an ivars hash. @parameters = coder.map["elements"].with_indifferent_access @permitted = coder.map["ivars"][:@permitted] when "!ruby/object:ActionController::Parameters" # YAML's Object format. Only needed because of the format # backwards compatibility above, otherwise equivalent to YAML's initialization. @parameters, @permitted = coder.map["parameters"], coder.map["permitted"] end end # Returns duplicate of object including all parameters. def deep_dup self.class.new(@parameters.deep_dup).tap do |duplicate| duplicate.permitted = @permitted end end protected attr_reader :parameters attr_writer :permitted def nested_attributes? @parameters.any? { |k, v| Parameters.nested_attribute?(k, v) } end def each_nested_attribute hash = self.class.new self.each { |k, v| hash[k] = yield v if Parameters.nested_attribute?(k, v) } hash end private def new_instance_with_inherited_permitted_status(hash) self.class.new(hash).tap do |new_instance| new_instance.permitted = @permitted end end def convert_parameters_to_hashes(value, using) case value when Array value.map { |v| convert_parameters_to_hashes(v, using) } when Hash value.transform_values do |v| convert_parameters_to_hashes(v, using) end.with_indifferent_access when Parameters value.send(using) else value end end def convert_hashes_to_parameters(key, value) converted = convert_value_to_parameters(value) @parameters[key] = converted unless converted.equal?(value) converted end def convert_value_to_parameters(value) case value when Array return value if converted_arrays.member?(value) converted = value.map { |_| convert_value_to_parameters(_) } converted_arrays << converted converted when Hash self.class.new(value) else value end end def each_element(object, &block) case object when Array object.grep(Parameters).map { |el| yield el }.compact when Parameters if object.nested_attributes? object.each_nested_attribute(&block) else yield object end end end def unpermitted_parameters!(params) unpermitted_keys = unpermitted_keys(params) if unpermitted_keys.any? case self.class.action_on_unpermitted_parameters when :log name = "unpermitted_parameters.action_controller" ActiveSupport::Notifications.instrument(name, keys: unpermitted_keys) when :raise raise ActionController::UnpermittedParameters.new(unpermitted_keys) end end end def unpermitted_keys(params) keys - params.keys - always_permitted_parameters end # # --- Filtering ---------------------------------------------------------- # # This is a white list of permitted scalar types that includes the ones # supported in XML and JSON requests. # # This list is in particular used to filter ordinary requests, String goes # as first element to quickly short-circuit the common case. # # If you modify this collection please update the API of +permit+ above. PERMITTED_SCALAR_TYPES = [ String, Symbol, NilClass, Numeric, TrueClass, FalseClass, Date, Time, # DateTimes are Dates, we document the type but avoid the redundant check. StringIO, IO, ActionDispatch::Http::UploadedFile, Rack::Test::UploadedFile, ] def permitted_scalar?(value) PERMITTED_SCALAR_TYPES.any? { |type| value.is_a?(type) } end # Adds existing keys to the params if their values are scalar. # # For example: # # puts self.keys #=> ["zipcode(90210i)"] # params = {} # # permitted_scalar_filter(params, "zipcode") # # puts params.keys # => ["zipcode"] def permitted_scalar_filter(params, permitted_key) permitted_key = permitted_key.to_s if has_key?(permitted_key) && permitted_scalar?(self[permitted_key]) params[permitted_key] = self[permitted_key] end each_key do |key| next unless key =~ /\(\d+[if]?\)\z/ next unless $~.pre_match == permitted_key params[key] = self[key] if permitted_scalar?(self[key]) end end def array_of_permitted_scalars?(value) if value.is_a?(Array) && value.all? { |element| permitted_scalar?(element) } yield value end end def non_scalar?(value) value.is_a?(Array) || value.is_a?(Parameters) end EMPTY_ARRAY = [] EMPTY_HASH = {} def hash_filter(params, filter) filter = filter.with_indifferent_access # Slicing filters out non-declared keys. slice(*filter.keys).each do |key, value| next unless value next unless has_key? key if filter[key] == EMPTY_ARRAY # Declaration { comment_ids: [] }. array_of_permitted_scalars?(self[key]) do |val| params[key] = val end elsif filter[key] == EMPTY_HASH # Declaration { preferences: {} }. if value.is_a?(Parameters) params[key] = permit_any_in_parameters(value) end elsif non_scalar?(value) # Declaration { user: :name } or { user: [:name, :age, { address: ... }] }. params[key] = each_element(value) do |element| element.permit(*Array.wrap(filter[key])) end end end end def permit_any_in_parameters(params) self.class.new.tap do |sanitized| params.each do |key, value| case value when ->(v) { permitted_scalar?(v) } sanitized[key] = value when Array sanitized[key] = permit_any_in_array(value) when Parameters sanitized[key] = permit_any_in_parameters(value) else # Filter this one out. end end end end def permit_any_in_array(array) [].tap do |sanitized| array.each do |element| case element when ->(e) { permitted_scalar?(e) } sanitized << element when Parameters sanitized << permit_any_in_parameters(element) else # Filter this one out. end end end end def initialize_copy(source) super @parameters = @parameters.dup end end # == Strong \Parameters # # It provides an interface for protecting attributes from end-user # assignment. This makes Action Controller parameters forbidden # to be used in Active Model mass assignment until they have been explicitly # enumerated. # # In addition, parameters can be marked as required and flow through a # predefined raise/rescue flow to end up as a <tt>400 Bad Request</tt> with no # effort. # # class PeopleController < ActionController::Base # # Using "Person.create(params[:person])" would raise an # # ActiveModel::ForbiddenAttributesError exception because it'd # # be using mass assignment without an explicit permit step. # # This is the recommended form: # def create # Person.create(person_params) # end # # # This will pass with flying colors as long as there's a person key in the # # parameters, otherwise it'll raise an ActionController::ParameterMissing # # exception, which will get caught by ActionController::Base and turned # # into a 400 Bad Request reply. # def update # redirect_to current_account.people.find(params[:id]).tap { |person| # person.update!(person_params) # } # end # # private # # Using a private method to encapsulate the permissible parameters is # # a good pattern since you'll be able to reuse the same permit # # list between create and update. Also, you can specialize this method # # with per-user checking of permissible attributes. # def person_params # params.require(:person).permit(:name, :age) # end # end # # In order to use <tt>accepts_nested_attributes_for</tt> with Strong \Parameters, you # will need to specify which nested attributes should be permitted. You might want # to allow +:id+ and +:_destroy+, see ActiveRecord::NestedAttributes for more information. # # class Person # has_many :pets # accepts_nested_attributes_for :pets # end # # class PeopleController < ActionController::Base # def create # Person.create(person_params) # end # # ... # # private # # def person_params # # It's mandatory to specify the nested attributes that should be permitted. # # If you use `permit` with just the key that points to the nested attributes hash, # # it will return an empty hash. # params.require(:person).permit(:name, :age, pets_attributes: [ :id, :name, :category ]) # end # end # # See ActionController::Parameters.require and ActionController::Parameters.permit # for more information. module StrongParameters # Returns a new ActionController::Parameters object that # has been instantiated with the <tt>request.parameters</tt>. def params @_params ||= Parameters.new(request.parameters) end # Assigns the given +value+ to the +params+ hash. If +value+ # is a Hash, this will create an ActionController::Parameters # object that has been instantiated with the given +value+ hash. def params=(value) @_params = value.is_a?(Hash) ? Parameters.new(value) : value end end end
arunagw/rails
actionpack/lib/action_controller/metal/strong_parameters.rb
Ruby
mit
40,618
Rails.application.routes.draw do resources :products, only: [:index, :show] get '/restricted', to: 'pages#restricted' root 'pages#index' end
jeyavel-velankani/Jel_Apps
Sitepoint-source-apps/Caching/config/routes.rb
Ruby
mit
149
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef DOBBSCOIN_ECCRYPTOVERIFY_H #define DOBBSCOIN_ECCRYPTOVERIFY_H #include <vector> #include <cstdlib> class uint256; namespace eccrypto { bool Check(const unsigned char *vch); bool CheckSignatureElement(const unsigned char *vch, int len, bool half); } // eccrypto namespace #endif // DOBBSCOIN_ECCRYPTOVERIFY_H
dobbscoin/dobbscoin-source
src/eccryptoverify.h
C
mit
556
package cli import ( "fmt" "time" "github.com/opentable/sous/util/cmdr" "github.com/opentable/sous/util/logging" ) type invocationMessage struct { callerInfo logging.CallerInfo args []string interval logging.MessageInterval } func reportInvocation(ls logging.LogSink, start time.Time, args []string) { msg := newInvocationMessage(args, start) msg.callerInfo.ExcludeMe() logging.Deliver(ls, msg) } func newInvocationMessage(args []string, start time.Time) *invocationMessage { return &invocationMessage{ callerInfo: logging.GetCallerInfo(logging.NotHere()), args: args, interval: logging.CompleteInterval(start), } } func (msg *invocationMessage) DefaultLevel() logging.Level { return logging.InformationLevel } func (msg *invocationMessage) Message() string { return "Invoked" } func (msg *invocationMessage) EachField(f logging.FieldReportFn) { f("@loglov3-otl", logging.SousCliV1) msg.callerInfo.EachField(f) msg.interval.EachField(f) f("arguments", fmt.Sprintf("%q", msg.args)) } type cliResultMessage struct { callerInfo logging.CallerInfo args []string res cmdr.Result interval logging.MessageInterval } func reportCLIResult(logsink logging.LogSink, args []string, start time.Time, res cmdr.Result) { msg := newCLIResult(args, start, res) msg.callerInfo.ExcludeMe() logging.Deliver(logsink, msg) } func newCLIResult(args []string, start time.Time, res cmdr.Result) *cliResultMessage { return &cliResultMessage{ callerInfo: logging.GetCallerInfo(logging.NotHere()), args: args, res: res, interval: logging.CompleteInterval(start), } } func (msg *cliResultMessage) DefaultLevel() logging.Level { return logging.InformationLevel } func (msg *cliResultMessage) Message() string { return fmt.Sprintf("Returned result: %q", msg.res) } func (msg *cliResultMessage) EachField(f logging.FieldReportFn) { f("@loglov3-otl", logging.SousCliV1) msg.callerInfo.EachField(f) msg.interval.EachField(f) f("arguments", fmt.Sprintf("%q", msg.args)) f("exit-code", msg.res.ExitCode()) }
samsalisbury/sous
cli/messages.go
GO
mit
2,080
package com.geth1b.amzn.oa; import static org.junit.Assert.assertArrayEquals; import org.junit.Before; import org.junit.Test; /** * @author geth1b */ public class _20160817_ItemRecommendations_Test { private _20160817_ItemRecommendations solution; private String[] strs; @Before public void setUp() { solution = new _20160817_ItemRecommendations(); strs = new String[]{ "first:ABC","first:HIJ","sec:HIJ","sec:KLM","third:NOP","fourth:ABC","fourth:QRS","first:DEF","fifth:KLM","fifth:TUV" }; } @Test public void determineRecommendations() { String itemid = "ABC"; int[] expected = new int[]{3,2}; assertArrayEquals(expected, solution.determineRecommendations_dfs(itemid, strs)); assertArrayEquals(expected, solution.determineRecommendations_bfs(itemid, strs)); assertArrayEquals(expected, solution.determineRecommendations(itemid, strs)); } @Test public void determineRecommendations_2() { String itemid = "NOP"; int[] expected = new int[]{0,0}; assertArrayEquals(expected, solution.determineRecommendations_dfs(itemid, strs)); assertArrayEquals(expected, solution.determineRecommendations_bfs(itemid, strs)); assertArrayEquals(expected, solution.determineRecommendations(itemid, strs)); } @Test public void determineRecommendations_3() { String itemid = "KLM"; int[] expected = new int[]{2,3}; assertArrayEquals(expected, solution.determineRecommendations_dfs(itemid, strs)); assertArrayEquals(expected, solution.determineRecommendations_bfs(itemid, strs)); assertArrayEquals(expected, solution.determineRecommendations(itemid, strs)); } }
geth1b/h1b-coding-interview
src/test/java/com/geth1b/amzn/oa/_20160817_ItemRecommendations_Test.java
Java
mit
1,675
console.log('this is a lib file')
dante1977/easepack
test/e2e/mock-ep-app-rc/extlibs/libs2.js
JavaScript
mit
33
'use strict'; var is = require( '../../is' ); var elesfn = ({ // Implemented from pseudocode from wikipedia aStar: function( options ){ var eles = this; options = options || {}; // Reconstructs the path from Start to End, acumulating the result in pathAcum var reconstructPath = function( start, end, cameFromMap, pathAcum ){ // Base case if( start == end ){ pathAcum.push( cy.getElementById( end ) ); return pathAcum; } if( end in cameFromMap ){ // We know which node is before the last one var previous = cameFromMap[ end ]; var previousEdge = cameFromEdge[ end ]; pathAcum.push( cy.getElementById( end ) ); pathAcum.push( cy.getElementById( previousEdge ) ); return reconstructPath( start, previous, cameFromMap, pathAcum ); } // We should not reach here! return undefined; }; // Returns the index of the element in openSet which has minimum fScore var findMin = function( openSet, fScore ){ if( openSet.length === 0 ){ // Should never be the case return undefined; } var minPos = 0; var tempScore = fScore[ openSet[0] ]; for( var i = 1; i < openSet.length; i++ ){ var s = fScore[ openSet[ i ] ]; if( s < tempScore ){ tempScore = s; minPos = i; } } return minPos; }; var cy = this._private.cy; // root - mandatory! if( options != null && options.root != null ){ var source = is.string( options.root ) ? // use it as a selector, e.g. "#rootID this.filter( options.root )[0] : options.root[0]; } else { return undefined; } // goal - mandatory! if( options.goal != null ){ var target = is.string( options.goal ) ? // use it as a selector, e.g. "#goalID this.filter( options.goal )[0] : options.goal[0]; } else { return undefined; } // Heuristic function - optional if( options.heuristic != null && is.fn( options.heuristic ) ){ var heuristic = options.heuristic; } else { var heuristic = function(){ return 0; }; // use constant if unspecified } // Weight function - optional if( options.weight != null && is.fn( options.weight ) ){ var weightFn = options.weight; } else { // If not specified, assume each edge has equal weight (1) var weightFn = function( e ){return 1;}; } // directed - optional if( options.directed != null ){ var directed = options.directed; } else { var directed = false; } var closedSet = []; var openSet = [ source.id() ]; var cameFrom = {}; var cameFromEdge = {}; var gScore = {}; var fScore = {}; gScore[ source.id() ] = 0; fScore[ source.id() ] = heuristic( source ); var edges = this.edges().stdFilter( function( e ){ return !e.isLoop(); } ); var nodes = this.nodes(); // Counter var steps = 0; // Main loop while( openSet.length > 0 ){ var minPos = findMin( openSet, fScore ); var cMin = cy.getElementById( openSet[ minPos ] ); steps++; // If we've found our goal, then we are done if( cMin.id() == target.id() ){ var rPath = reconstructPath( source.id(), target.id(), cameFrom, [] ); rPath.reverse(); return { found: true, distance: gScore[ cMin.id() ], path: eles.spawn( rPath ), steps: steps }; } // Add cMin to processed nodes closedSet.push( cMin.id() ); // Remove cMin from boundary nodes openSet.splice( minPos, 1 ); // Update scores for neighbors of cMin // Take into account if graph is directed or not var vwEdges = cMin.connectedEdges(); if( directed ){ vwEdges = vwEdges.stdFilter( function( ele ){ return ele.data( 'source' ) === cMin.id(); } ); } vwEdges = vwEdges.intersect( edges ); for( var i = 0; i < vwEdges.length; i++ ){ var e = vwEdges[ i ]; var w = e.connectedNodes().stdFilter( function( n ){ return n.id() !== cMin.id(); } ).intersect( nodes ); // if node is in closedSet, ignore it if( closedSet.indexOf( w.id() ) != -1 ){ continue; } // New tentative score for node w var tempScore = gScore[ cMin.id() ] + weightFn.apply( e, [ e ] ); // Update gScore for node w if: // w not present in openSet // OR // tentative gScore is less than previous value // w not in openSet if( openSet.indexOf( w.id() ) == -1 ){ gScore[ w.id() ] = tempScore; fScore[ w.id() ] = tempScore + heuristic( w ); openSet.push( w.id() ); // Add node to openSet cameFrom[ w.id() ] = cMin.id(); cameFromEdge[ w.id() ] = e.id(); continue; } // w already in openSet, but with greater gScore if( tempScore < gScore[ w.id() ] ){ gScore[ w.id() ] = tempScore; fScore[ w.id() ] = tempScore + heuristic( w ); cameFrom[ w.id() ] = cMin.id(); } } // End of neighbors update } // End of main loop // If we've reached here, then we've not reached our goal return { found: false, distance: undefined, path: undefined, steps: steps }; } }); // elesfn module.exports = elesfn;
rlugojr/cytoscape.js
src/collection/algorithms/a-star.js
JavaScript
mit
5,540
// // IncrementableLabel.h // IncrementableLabel // // Created by Tom Baranes on 08/05/16. // Copyright © 2016 Recisio. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for IncrementableLabel. FOUNDATION_EXPORT double IncrementableLabelVersionNumber; //! Project version string for IncrementableLabel. FOUNDATION_EXPORT const unsigned char IncrementableLabelVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <IncrementableLabel/PublicHeader.h>
recisio/IncrementableLabel
IncrementableLabel/IncrementableLabel iOS/IncrementableLabel.h
C
mit
556
package tpe.exceptions.trycatchfinally; import java.awt.EventQueue; import de.smits_net.games.framework.board.MainWindow; /** * Hauptklasse des Spiels. */ public class GameMain extends MainWindow { /** * Neues Spiel anlegen. */ public GameMain() { super("Watch me walk...", new GameBoard()); } /** * Startpunkt. * * @param args command line arguments. */ public static void main(String[] args) { // Spiel starten EventQueue.invokeLater(GameMain::new); } }
tpe-lecture/repo-27
06_ausnahmen/02_finally/src/tpe/exceptions/trycatchfinally/GameMain.java
Java
mit
542
import mongoose from 'mongoose'; let Schema = mongoose.Schema; let fileSchema = new Schema({ _id: { type: Schema.Types.ObjectId, auto: true }, key: { type: String, required: true }, date: { type: Date, default: new Date() }, meta: { type: { mime: { type: String }, size: { type: String }, name: { type: String } }} }, { collection: 'files', versionKey: false }); export default mongoose.model('File', fileSchema);
leozdgao/fileserver
src/model/file.js
JavaScript
mit
461
<?php /* * This file is part of the broadway/broadway package. * * (c) 2020 Broadway project * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Broadway\EventSourcing; use Broadway\Domain\DomainEventStream; /** * Interface implemented by event stream decorators. * * An event stream decorator can alter the domain event stream before it is * written. An example would be adding metadata before writing the events to * storage. */ interface EventStreamDecorator { public function decorateForWrite(string $aggregateType, string $aggregateIdentifier, DomainEventStream $eventStream): DomainEventStream; }
qandidate-labs/broadway
src/Broadway/EventSourcing/EventStreamDecorator.php
PHP
mit
738
using System.Collections.Generic; using System.Globalization; using Nuxleus.Asynchronous; using Nuxleus.WebService; namespace Nuxleus.Extension { public static class ExtensionMethods { public static IEnumerable<IAsync> AsIAsync(this ITask operation) { return operation.InvokeAsync(); } /// <summary> /// Modified from Oleg Tkachenko's SubstringBefore and SubstringAfter extension functions /// @ http://www.tkachenko.com/blog/archives/000684.html /// This will be moved into an appropriate class once I have the time. /// </summary> /// <param name="source"></param> /// <param name="value"></param> /// <returns></returns> public static string SubstringAfter(this string source, string value) { if (string.IsNullOrEmpty(value)) { return source; } CompareInfo compareInfo = CultureInfo.InvariantCulture.CompareInfo; int index = compareInfo.IndexOf(source, value, CompareOptions.Ordinal); if (index < 0) { //No such substring return string.Empty; } return source.Substring(index + value.Length); } public static string SubstringBefore(this string source, string value) { if (string.IsNullOrEmpty(value)) { return value; } CompareInfo compareInfo = CultureInfo.InvariantCulture.CompareInfo; int index = compareInfo.IndexOf(source, value, CompareOptions.Ordinal); if (index < 0) { //No such substring return string.Empty; } return source.Substring(0, index); } } }
Microsoft/vsminecraft
dependencies/protobuf-net/SilverlightExtended/Nuxleus.Extension/ExtensionMethods.cs
C#
mit
1,763
package net.ossrs.yasea; import android.os.Handler; import android.os.Message; import java.lang.ref.WeakReference; /** * Created by leo.ma on 2016/11/4. */ public class SrsEncodeHandler extends Handler { private static final int MSG_ENCODE_NETWORK_WEAK = 0; private static final int MSG_ENCODE_NETWORK_RESUME = 1; private static final int MSG_ENCODE_ILLEGAL_ARGUMENT_EXCEPTION = 2; private WeakReference<SrsEncodeListener> mWeakListener; public SrsEncodeHandler(SrsEncodeListener listener) { mWeakListener = new WeakReference<>(listener); } public void notifyNetworkWeak() { sendEmptyMessage(MSG_ENCODE_NETWORK_WEAK); } public void notifyNetworkResume() { sendEmptyMessage(MSG_ENCODE_NETWORK_RESUME); } public void notifyEncodeIllegalArgumentException(IllegalArgumentException e) { obtainMessage(MSG_ENCODE_ILLEGAL_ARGUMENT_EXCEPTION, e).sendToTarget(); } @Override // runs on UI thread public void handleMessage(Message msg) { SrsEncodeListener listener = mWeakListener.get(); if (listener == null) { return; } switch (msg.what) { case MSG_ENCODE_NETWORK_WEAK: listener.onNetworkWeak(); break; case MSG_ENCODE_NETWORK_RESUME: listener.onNetworkResume(); break; case MSG_ENCODE_ILLEGAL_ARGUMENT_EXCEPTION: listener.onEncodeIllegalArgumentException((IllegalArgumentException) msg.obj); default: throw new RuntimeException("unknown msg " + msg.what); } } public interface SrsEncodeListener { void onNetworkWeak(); void onNetworkResume(); void onEncodeIllegalArgumentException(IllegalArgumentException e); } }
illuminoo/yasea
library/src/main/java/net/ossrs/yasea/SrsEncodeHandler.java
Java
mit
1,915
import os import socket import asyncio import webbrowser import aiohttp from aiohttp import web from hailtop.config import get_deploy_config from hailtop.auth import get_tokens, namespace_auth_headers from hailtop.tls import get_context_specific_ssl_client_session def init_parser(parser): parser.add_argument("--namespace", "-n", type=str, help="Specify namespace for auth server. (default: from deploy configuration)") routes = web.RouteTableDef() @routes.get('/oauth2callback') async def callback(request): q = request.app['q'] code = request.query['code'] await q.put(code) # FIXME redirect a nice page like auth.hail.is/hailctl/authenciated with link to more information return web.Response(text='hailctl is now authenticated.') async def start_server(): app = web.Application() app['q'] = asyncio.Queue() app.add_routes(routes) runner = web.AppRunner(app) await runner.setup() sock = socket.socket() sock.bind(("127.0.0.1", 0)) sock.listen(128) _, port = sock.getsockname() site = web.SockSite(runner, sock, shutdown_timeout=0) await site.start() return (runner, port) async def auth_flow(deploy_config, auth_ns, session): runner, port = await start_server() async with session.get(deploy_config.url('auth', '/api/v1alpha/login'), params={'callback_port': port}) as resp: resp = await resp.json() authorization_url = resp['authorization_url'] state = resp['state'] print(f''' Visit the following URL to log into Hail with Google: {authorization_url} Opening in your browser. ''') webbrowser.open(authorization_url) code = await runner.app['q'].get() await runner.cleanup() async with session.get( deploy_config.url('auth', '/api/v1alpha/oauth2callback'), params={ 'callback_port': port, 'code': code, 'state': state }) as resp: resp = await resp.json() token = resp['token'] username = resp['username'] tokens = get_tokens() tokens[auth_ns] = token dot_hail_dir = os.path.expanduser('~/.hail') if not os.path.exists(dot_hail_dir): os.mkdir(dot_hail_dir, mode=0o700) tokens.write() if auth_ns == 'default': print(f'Logged in as {username}.') else: print(f'Logged into namespace {auth_ns} as {username}.') async def async_main(args): deploy_config = get_deploy_config() if args.namespace: auth_ns = args.namespace deploy_config = deploy_config.with_service('auth', auth_ns) else: auth_ns = deploy_config.service_ns('auth') headers = namespace_auth_headers(deploy_config, auth_ns, authorize_target=False) async with get_context_specific_ssl_client_session( raise_for_status=True, timeout=aiohttp.ClientTimeout(total=60), headers=headers) as session: await auth_flow(deploy_config, auth_ns, session) def main(args, pass_through_args): # pylint: disable=unused-argument loop = asyncio.get_event_loop() loop.run_until_complete(async_main(args))
danking/hail
hail/python/hailtop/hailctl/auth/login.py
Python
mit
3,167
/* * oxTrust is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. * * Copyright (c) 2014, Gluu */ package org.gluu.oxtrust.model.scim; /** * SCIM Entitlements * * @author Reda Zerrad Date: 04.23.2012 */ public class ScimEntitlements { private String value; public ScimEntitlements() { value = ""; } public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } }
diedertimmers/oxTrust
server/src/main/java/org/gluu/oxtrust/model/scim/ScimEntitlements.java
Java
mit
480
// // ChatViewController.h // MdcLib // // Created by Le Cuong on 12/2/16. // Copyright © 2016 lecuong. All rights reserved. // #import <UIKit/UIKit.h> @interface ChatViewController : UIViewController @end
duplicater/MdcLib
Example/MdcLib/ChatViewController.h
C
mit
214
/* * The MIT License (MIT) * * Copyright (c) 2007-2015 Broad Institute * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.broad.igv.tools.sort; import htsjdk.tribble.readers.AsciiLineReader; import java.io.File; import java.io.IOException; import java.io.PrintWriter; /** * @author jrobinso */ public class SAMSorter extends Sorter { public SAMSorter(File inputFile, File outputFile) { super(inputFile, outputFile); } @Override Parser getParser() { return new Parser(2, 3); } @Override String writeHeader(AsciiLineReader reader, PrintWriter writer) throws IOException { String nextLine = reader.readLine(); while (nextLine != null && nextLine.startsWith("@")) { writer.println(nextLine); nextLine = reader.readLine(); } // First alignment row return nextLine; } }
godotgildor/igv
src/org/broad/igv/tools/sort/SAMSorter.java
Java
mit
2,032
# SignalR > see https://aka.ms/autorest This is the AutoRest configuration file for SignalR. --- ## Getting Started To build the SDK for SignalR, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: > `autorest` To see additional help and options, run: > `autorest --help` --- ## Configuration ### Basic Information These are the global settings for the SignalR API. ``` yaml openapi-type: arm tag: package-2018-10-01 ``` ### Suppression ``` yaml directive: - suppress: EnumInsteadOfBoolean from: signalr.json where: $.definitions.NameAvailability.properties.nameAvailable reason: The boolean properties 'nameAvailable' is actually boolean value defined by Azure API spec - suppress: EnumInsteadOfBoolean from: signalr.json where: $.definitions.Dimension.properties.toBeExportedForShoebox reason: The boolean properties 'toBeExportedForShoebox' is defined by Geneva metrics ``` ### Tag: package-2018-10-01 These settings apply only when `--tag=package-2018-10-01` is specified on the command line. ``` yaml $(tag) == 'package-2018-10-01' input-file: - Microsoft.SignalRService/stable/2018-10-01/signalr.json ``` ### Tag: package-2018-03-01-preview These settings apply only when `--tag=package-2018-03-01-preview` is specified on the command line. ``` yaml $(tag) == 'package-2018-03-01-preview' input-file: - Microsoft.SignalRService/preview/2018-03-01-preview/signalr.json ``` --- # Code Generation ## Swagger to SDK This section describes what SDK should be generated by the automatic system. This is not used by Autorest itself. ``` yaml $(swagger-to-sdk) swagger-to-sdk: - repo: azure-sdk-for-python - repo: azure-sdk-for-java - repo: azure-sdk-for-node - repo: azure-sdk-for-js - repo: azure-sdk-for-go - repo: azure-sdk-for-ruby after_scripts: - bundle install && rake arm:regen_all_profiles['azure_mgmt_signalr'] ``` ## Python These settings apply only when `--python` is specified on the command line. Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`. Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. ``` yaml $(python) python-mode: create python: azure-arm: true license-header: MICROSOFT_MIT_NO_VERSION payload-flattening-threshold: 2 namespace: azure.mgmt.signalr package-name: azure-mgmt-signalr package-version: 0.1.0 clear-output-folder: true ``` ``` yaml $(python) && $(python-mode) == 'update' python: no-namespace-folders: true output-folder: $(python-sdks-folder)/azure-mgmt-signalr/azure/mgmt/signalr ``` ``` yaml $(python) && $(python-mode) == 'create' python: basic-setup-py: true output-folder: $(python-sdks-folder)/azure-mgmt-signalr ``` ## Go See configuration in [readme.go.md](./readme.go.md) ## Java These settings apply only when `--java` is specified on the command line. Please also specify `--azure-libraries-for-java-folder=<path to the root directory of your azure-libraries-for-java clone>`. ``` yaml $(java) azure-arm: true fluent: true namespace: com.microsoft.azure.management.signalr license-header: MICROSOFT_MIT_NO_CODEGEN payload-flattening-threshold: 1 output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-signalr ``` ### Java multi-api ``` yaml $(java) && $(multiapi) batch: - tag: package-2018-03-01-preview - tag: package-2018-10-01 ``` ### Tag: package-2018-10-01 and java These settings apply only when `--tag=package-2018-10-01 --java` is specified on the command line. Please also specify `--azure-libraries-for-java-folder=<path to the root directory of your azure-sdk-for-java clone>`. ``` yaml $(tag) == 'package-2018-10-01' && $(java) && $(multiapi) java: namespace: com.microsoft.azure.management.signalr.v2018_10_01 output-folder: $(azure-libraries-for-java-folder)/signalr/resource-manager/v2018_10_01 regenerate-manager: true generate-interface: true ``` ### Tag: package-2018-03-01-preview and java These settings apply only when `--tag=package-2018-03-01-preview --java` is specified on the command line. Please also specify `--azure-libraries-for-java-folder=<path to the root directory of your azure-sdk-for-java clone>`. ``` yaml $(tag) == 'package-2018-03-01-preview' && $(java) && $(multiapi) java: namespace: com.microsoft.azure.management.signalr.v2018_03_01_preview output-folder: $(azure-libraries-for-java-folder)/signalr/resource-manager/v2018_03_01_preview regenerate-manager: true generate-interface: true ``` ## C# These settings apply only when `--csharp` is specified on the command line. Please also specify `--csharp-sdks-folder=<path to "SDKs" directory of your azure-sdk-for-net clone>`. ``` yaml $(csharp) csharp: # last generated with AutoRest.0.17.3 azure-arm: true license-header: MICROSOFT_MIT_NO_VERSION namespace: Microsoft.Azure.Management.SignalR output-folder: $(csharp-sdks-folder)/SignalR/Management.SignalR/Generated clear-output-folder: true ```
Nking92/azure-rest-api-specs
specification/signalr/resource-manager/readme.md
Markdown
mit
5,032
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width" /> <link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" /> <title>StringBuilder - Android SDK | Android Developers</title> <!-- STYLESHEETS --> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto"> <link href="../../../assets/css/default.css" rel="stylesheet" type="text/css"> <!-- FULLSCREEN STYLESHEET --> <link href="../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen" type="text/css"> <!-- JAVASCRIPT --> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script src="../../../assets/js/android_3p-bundle.js" type="text/javascript"></script> <script type="text/javascript"> var toRoot = "../../../"; var devsite = false; </script> <script src="../../../assets/js/docs.js" type="text/javascript"></script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-5831155-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body class="gc-documentation develop" itemscope itemtype="http://schema.org/Article"> <div id="doc-api-level" class="1" style="display:none"></div> <a name="top"></a> <a name="top"></a> <!-- Header --> <div id="header"> <div class="wrap" id="header-wrap"> <div class="col-3 logo"> <a href="../../../index.html"> <img src="../../../assets/images/dac_logo.png" width="123" height="25" alt="Android Developers" /> </a> <div class="btn-quicknav" id="btn-quicknav"> <a href="#" class="arrow-inactive">Quicknav</a> <a href="#" class="arrow-active">Quicknav</a> </div> </div> <ul class="nav-x col-9"> <li class="design"> <a href="../../../design/index.html" zh-tw-lang="設計" zh-cn-lang="设计" ru-lang="Проектирование" ko-lang="디자인" ja-lang="設計" es-lang="Diseñar" >Design</a></li> <li class="develop"><a href="../../../develop/index.html" zh-tw-lang="開發" zh-cn-lang="开发" ru-lang="Разработка" ko-lang="개발" ja-lang="開発" es-lang="Desarrollar" >Develop</a></li> <li class="distribute last"><a href="../../../distribute/index.html" zh-tw-lang="發佈" zh-cn-lang="分发" ru-lang="Распространение" ko-lang="배포" ja-lang="配布" es-lang="Distribuir" >Distribute</a></li> </ul> <!-- New Search --> <div class="menu-container"> <div class="moremenu"> <div id="more-btn"></div> </div> <div class="morehover" id="moremenu"> <div class="top"></div> <div class="mid"> <div class="header">Links</div> <ul> <li><a href="https://play.google.com/apps/publish/">Google Play Developer Console</a></li> <li><a href="http://android-developers.blogspot.com/">Android Developers Blog</a></li> <li><a href="../../../about/index.html">About Android</a></li> </ul> <div class="header">Android Sites</div> <ul> <li><a href="http://www.android.com">Android.com</a></li> <li class="active"><a>Android Developers</a></li> <li><a href="http://source.android.com">Android Open Source Project</a></li> </ul> <br class="clearfix" /> </div> <div class="bottom"></div> </div> <div class="search" id="search-container"> <div class="search-inner"> <div id="search-btn"></div> <div class="left"></div> <form onsubmit="return submit_search()"> <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q" onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)" onkeydown="return search_changed(event, true, '../../../')" onkeyup="return search_changed(event, false, '../../../')" /> </form> <div class="right"></div> <a class="close hide">close</a> <div class="left"></div> <div class="right"></div> </div> </div> <div class="search_filtered_wrapper reference"> <div class="suggest-card reference no-display"> <ul class="search_filtered"> </ul> </div> </div> <div class="search_filtered_wrapper docs"> <div class="suggest-card dummy no-display">&nbsp;</div> <div class="suggest-card develop no-display"> <ul class="search_filtered"> </ul> <div class="child-card guides no-display"> </div> <div class="child-card training no-display"> </div> </div> <div class="suggest-card design no-display"> <ul class="search_filtered"> </ul> </div> <div class="suggest-card distribute no-display"> <ul class="search_filtered"> </ul> </div> </div> </div> <!-- /New Search> <!-- Expanded quicknav --> <div id="quicknav" class="col-9"> <ul> <li class="design"> <ul> <li><a href="../../../design/index.html">Get Started</a></li> <li><a href="../../../design/style/index.html">Style</a></li> <li><a href="../../../design/patterns/index.html">Patterns</a></li> <li><a href="../../../design/building-blocks/index.html">Building Blocks</a></li> <li><a href="../../../design/downloads/index.html">Downloads</a></li> <li><a href="../../../design/videos/index.html">Videos</a></li> </ul> </li> <li class="develop"> <ul> <li><a href="../../../training/index.html" zh-tw-lang="訓練課程" zh-cn-lang="培训" ru-lang="Курсы" ko-lang="교육" ja-lang="トレーニング" es-lang="Capacitación" >Training</a></li> <li><a href="../../../guide/components/index.html" zh-tw-lang="API 指南" zh-cn-lang="API 指南" ru-lang="Руководства по API" ko-lang="API 가이드" ja-lang="API ガイド" es-lang="Guías de la API" >API Guides</a></li> <li><a href="../../../reference/packages.html" zh-tw-lang="參考資源" zh-cn-lang="参考" ru-lang="Справочник" ko-lang="참조문서" ja-lang="リファレンス" es-lang="Referencia" >Reference</a></li> <li><a href="../../../tools/index.html" zh-tw-lang="相關工具" zh-cn-lang="工具" ru-lang="Инструменты" ko-lang="도구" ja-lang="ツール" es-lang="Herramientas" >Tools</a> <ul><li><a href="../../../sdk/index.html">Get the SDK</a></li></ul> </li> <li><a href="../../../google/index.html">Google Services</a> </li> </ul> </li> <li class="distribute last"> <ul> <li><a href="../../../distribute/index.html">Google Play</a></li> <li><a href="../../../distribute/googleplay/publish/index.html">Publishing</a></li> <li><a href="../../../distribute/googleplay/promote/index.html">Promoting</a></li> <li><a href="../../../distribute/googleplay/quality/index.html">App Quality</a></li> <li><a href="../../../distribute/googleplay/spotlight/index.html">Spotlight</a></li> <li><a href="../../../distribute/open.html">Open Distribution</a></li> </ul> </li> </ul> </div> <!-- /Expanded quicknav --> </div> </div> <!-- /Header --> <div id="searchResults" class="wrap" style="display:none;"> <h2 id="searchTitle">Results</h2> <div id="leftSearchControl" class="search-control">Loading...</div> </div> <!-- Secondary x-nav --> <div id="nav-x"> <div class="wrap"> <ul class="nav-x col-9 develop" style="width:100%"> <li class="training"><a href="../../../training/index.html" zh-tw-lang="訓練課程" zh-cn-lang="培训" ru-lang="Курсы" ko-lang="교육" ja-lang="トレーニング" es-lang="Capacitación" >Training</a></li> <li class="guide"><a href="../../../guide/components/index.html" zh-tw-lang="API 指南" zh-cn-lang="API 指南" ru-lang="Руководства по API" ko-lang="API 가이드" ja-lang="API ガイド" es-lang="Guías de la API" >API Guides</a></li> <li class="reference"><a href="../../../reference/packages.html" zh-tw-lang="參考資源" zh-cn-lang="参考" ru-lang="Справочник" ko-lang="참조문서" ja-lang="リファレンス" es-lang="Referencia" >Reference</a></li> <li class="tools"><a href="../../../tools/index.html" zh-tw-lang="相關工具" zh-cn-lang="工具" ru-lang="Инструменты" ko-lang="도구" ja-lang="ツール" es-lang="Herramientas" >Tools</a></li> <li class="google"><a href="../../../google/index.html" >Google Services</a> </li> </ul> </div> </div> <!-- /Sendondary x-nav --> <div class="wrap clearfix" id="body-content"> <div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement"> <div id="devdoc-nav"> <a class="totop" href="#top" data-g-event="left-nav-top">to top</a> <div id="api-nav-header"> <div id="api-level-toggle"> <label for="apiLevelCheckbox" class="disabled">API level: </label> <div class="select-wrapper"> <select id="apiLevelSelector"> <!-- option elements added by buildApiLevelSelector() --> </select> </div> </div><!-- end toggle --> <div id="api-nav-title">Android APIs</div> </div><!-- end nav header --> <script> var SINCE_DATA = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19' ]; buildApiLevelSelector(); </script> <div id="swapper"> <div id="nav-panels"> <div id="resize-packages-nav"> <div id="packages-nav" class="scroll-pane"> <ul> <li class="api apilevel-1"> <a href="../../../reference/android/package-summary.html">android</a></li> <li class="api apilevel-4"> <a href="../../../reference/android/accessibilityservice/package-summary.html">android.accessibilityservice</a></li> <li class="api apilevel-5"> <a href="../../../reference/android/accounts/package-summary.html">android.accounts</a></li> <li class="api apilevel-11"> <a href="../../../reference/android/animation/package-summary.html">android.animation</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/app/package-summary.html">android.app</a></li> <li class="api apilevel-8"> <a href="../../../reference/android/app/admin/package-summary.html">android.app.admin</a></li> <li class="api apilevel-8"> <a href="../../../reference/android/app/backup/package-summary.html">android.app.backup</a></li> <li class="api apilevel-3"> <a href="../../../reference/android/appwidget/package-summary.html">android.appwidget</a></li> <li class="api apilevel-5"> <a href="../../../reference/android/bluetooth/package-summary.html">android.bluetooth</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/content/package-summary.html">android.content</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/content/pm/package-summary.html">android.content.pm</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/content/res/package-summary.html">android.content.res</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/database/package-summary.html">android.database</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/database/sqlite/package-summary.html">android.database.sqlite</a></li> <li class="api apilevel-11"> <a href="../../../reference/android/drm/package-summary.html">android.drm</a></li> <li class="api apilevel-4"> <a href="../../../reference/android/gesture/package-summary.html">android.gesture</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/graphics/package-summary.html">android.graphics</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/graphics/drawable/package-summary.html">android.graphics.drawable</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/graphics/drawable/shapes/package-summary.html">android.graphics.drawable.shapes</a></li> <li class="api apilevel-19"> <a href="../../../reference/android/graphics/pdf/package-summary.html">android.graphics.pdf</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/hardware/package-summary.html">android.hardware</a></li> <li class="api apilevel-17"> <a href="../../../reference/android/hardware/display/package-summary.html">android.hardware.display</a></li> <li class="api apilevel-16"> <a href="../../../reference/android/hardware/input/package-summary.html">android.hardware.input</a></li> <li class="api apilevel-18"> <a href="../../../reference/android/hardware/location/package-summary.html">android.hardware.location</a></li> <li class="api apilevel-12"> <a href="../../../reference/android/hardware/usb/package-summary.html">android.hardware.usb</a></li> <li class="api apilevel-3"> <a href="../../../reference/android/inputmethodservice/package-summary.html">android.inputmethodservice</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/location/package-summary.html">android.location</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/media/package-summary.html">android.media</a></li> <li class="api apilevel-9"> <a href="../../../reference/android/media/audiofx/package-summary.html">android.media.audiofx</a></li> <li class="api apilevel-14"> <a href="../../../reference/android/media/effect/package-summary.html">android.media.effect</a></li> <li class="api apilevel-12"> <a href="../../../reference/android/mtp/package-summary.html">android.mtp</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/net/package-summary.html">android.net</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/net/http/package-summary.html">android.net.http</a></li> <li class="api apilevel-16"> <a href="../../../reference/android/net/nsd/package-summary.html">android.net.nsd</a></li> <li class="api apilevel-12"> <a href="../../../reference/android/net/rtp/package-summary.html">android.net.rtp</a></li> <li class="api apilevel-9"> <a href="../../../reference/android/net/sip/package-summary.html">android.net.sip</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/net/wifi/package-summary.html">android.net.wifi</a></li> <li class="api apilevel-14"> <a href="../../../reference/android/net/wifi/p2p/package-summary.html">android.net.wifi.p2p</a></li> <li class="api apilevel-16"> <a href="../../../reference/android/net/wifi/p2p/nsd/package-summary.html">android.net.wifi.p2p.nsd</a></li> <li class="api apilevel-9"> <a href="../../../reference/android/nfc/package-summary.html">android.nfc</a></li> <li class="api apilevel-19"> <a href="../../../reference/android/nfc/cardemulation/package-summary.html">android.nfc.cardemulation</a></li> <li class="api apilevel-10"> <a href="../../../reference/android/nfc/tech/package-summary.html">android.nfc.tech</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/opengl/package-summary.html">android.opengl</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/os/package-summary.html">android.os</a></li> <li class="api apilevel-9"> <a href="../../../reference/android/os/storage/package-summary.html">android.os.storage</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/preference/package-summary.html">android.preference</a></li> <li class="api apilevel-19"> <a href="../../../reference/android/print/package-summary.html">android.print</a></li> <li class="api apilevel-19"> <a href="../../../reference/android/print/pdf/package-summary.html">android.print.pdf</a></li> <li class="api apilevel-19"> <a href="../../../reference/android/printservice/package-summary.html">android.printservice</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/provider/package-summary.html">android.provider</a></li> <li class="api apilevel-11"> <a href="../../../reference/android/renderscript/package-summary.html">android.renderscript</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/sax/package-summary.html">android.sax</a></li> <li class="api apilevel-14"> <a href="../../../reference/android/security/package-summary.html">android.security</a></li> <li class="api apilevel-17"> <a href="../../../reference/android/service/dreams/package-summary.html">android.service.dreams</a></li> <li class="api apilevel-18"> <a href="../../../reference/android/service/notification/package-summary.html">android.service.notification</a></li> <li class="api apilevel-14"> <a href="../../../reference/android/service/textservice/package-summary.html">android.service.textservice</a></li> <li class="api apilevel-7"> <a href="../../../reference/android/service/wallpaper/package-summary.html">android.service.wallpaper</a></li> <li class="api apilevel-3"> <a href="../../../reference/android/speech/package-summary.html">android.speech</a></li> <li class="api apilevel-4"> <a href="../../../reference/android/speech/tts/package-summary.html">android.speech.tts</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v13/app/package-summary.html">android.support.v13.app</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/accessibilityservice/package-summary.html">android.support.v4.accessibilityservice</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/app/package-summary.html">android.support.v4.app</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/content/package-summary.html">android.support.v4.content</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/content/pm/package-summary.html">android.support.v4.content.pm</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/database/package-summary.html">android.support.v4.database</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/graphics/drawable/package-summary.html">android.support.v4.graphics.drawable</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/hardware/display/package-summary.html">android.support.v4.hardware.display</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/media/package-summary.html">android.support.v4.media</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/net/package-summary.html">android.support.v4.net</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/os/package-summary.html">android.support.v4.os</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/print/package-summary.html">android.support.v4.print</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/text/package-summary.html">android.support.v4.text</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/util/package-summary.html">android.support.v4.util</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/view/package-summary.html">android.support.v4.view</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/view/accessibility/package-summary.html">android.support.v4.view.accessibility</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v4/widget/package-summary.html">android.support.v4.widget</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v7/app/package-summary.html">android.support.v7.app</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v7/appcompat/package-summary.html">android.support.v7.appcompat</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v7/gridlayout/package-summary.html">android.support.v7.gridlayout</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v7/media/package-summary.html">android.support.v7.media</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v7/mediarouter/package-summary.html">android.support.v7.mediarouter</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v7/view/package-summary.html">android.support.v7.view</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v7/widget/package-summary.html">android.support.v7.widget</a></li> <li class="api apilevel-"> <a href="../../../reference/android/support/v8/renderscript/package-summary.html">android.support.v8.renderscript</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/telephony/package-summary.html">android.telephony</a></li> <li class="api apilevel-5"> <a href="../../../reference/android/telephony/cdma/package-summary.html">android.telephony.cdma</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/telephony/gsm/package-summary.html">android.telephony.gsm</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/test/package-summary.html">android.test</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/test/mock/package-summary.html">android.test.mock</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/test/suitebuilder/package-summary.html">android.test.suitebuilder</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/text/package-summary.html">android.text</a></li> <li class="api apilevel-3"> <a href="../../../reference/android/text/format/package-summary.html">android.text.format</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/text/method/package-summary.html">android.text.method</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/text/style/package-summary.html">android.text.style</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/text/util/package-summary.html">android.text.util</a></li> <li class="api apilevel-19"> <a href="../../../reference/android/transition/package-summary.html">android.transition</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/util/package-summary.html">android.util</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/view/package-summary.html">android.view</a></li> <li class="api apilevel-4"> <a href="../../../reference/android/view/accessibility/package-summary.html">android.view.accessibility</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/view/animation/package-summary.html">android.view.animation</a></li> <li class="api apilevel-3"> <a href="../../../reference/android/view/inputmethod/package-summary.html">android.view.inputmethod</a></li> <li class="api apilevel-14"> <a href="../../../reference/android/view/textservice/package-summary.html">android.view.textservice</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/webkit/package-summary.html">android.webkit</a></li> <li class="api apilevel-1"> <a href="../../../reference/android/widget/package-summary.html">android.widget</a></li> <li class="api apilevel-1"> <a href="../../../reference/dalvik/bytecode/package-summary.html">dalvik.bytecode</a></li> <li class="api apilevel-1"> <a href="../../../reference/dalvik/system/package-summary.html">dalvik.system</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/awt/font/package-summary.html">java.awt.font</a></li> <li class="api apilevel-3"> <a href="../../../reference/java/beans/package-summary.html">java.beans</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/io/package-summary.html">java.io</a></li> <li class="selected api apilevel-1"> <a href="../../../reference/java/lang/package-summary.html">java.lang</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/lang/annotation/package-summary.html">java.lang.annotation</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/lang/ref/package-summary.html">java.lang.ref</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/lang/reflect/package-summary.html">java.lang.reflect</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/math/package-summary.html">java.math</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/net/package-summary.html">java.net</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/nio/package-summary.html">java.nio</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/nio/channels/package-summary.html">java.nio.channels</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/nio/channels/spi/package-summary.html">java.nio.channels.spi</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/nio/charset/package-summary.html">java.nio.charset</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/nio/charset/spi/package-summary.html">java.nio.charset.spi</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/security/package-summary.html">java.security</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/security/acl/package-summary.html">java.security.acl</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/security/cert/package-summary.html">java.security.cert</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/security/interfaces/package-summary.html">java.security.interfaces</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/security/spec/package-summary.html">java.security.spec</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/sql/package-summary.html">java.sql</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/text/package-summary.html">java.text</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/util/package-summary.html">java.util</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/util/concurrent/package-summary.html">java.util.concurrent</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/util/concurrent/atomic/package-summary.html">java.util.concurrent.atomic</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/util/concurrent/locks/package-summary.html">java.util.concurrent.locks</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/util/jar/package-summary.html">java.util.jar</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/util/logging/package-summary.html">java.util.logging</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/util/prefs/package-summary.html">java.util.prefs</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/util/regex/package-summary.html">java.util.regex</a></li> <li class="api apilevel-1"> <a href="../../../reference/java/util/zip/package-summary.html">java.util.zip</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/crypto/package-summary.html">javax.crypto</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/crypto/interfaces/package-summary.html">javax.crypto.interfaces</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/crypto/spec/package-summary.html">javax.crypto.spec</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/microedition/khronos/egl/package-summary.html">javax.microedition.khronos.egl</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/microedition/khronos/opengles/package-summary.html">javax.microedition.khronos.opengles</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/net/package-summary.html">javax.net</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/net/ssl/package-summary.html">javax.net.ssl</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/security/auth/package-summary.html">javax.security.auth</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/security/auth/callback/package-summary.html">javax.security.auth.callback</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/security/auth/login/package-summary.html">javax.security.auth.login</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/security/auth/x500/package-summary.html">javax.security.auth.x500</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/security/cert/package-summary.html">javax.security.cert</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/sql/package-summary.html">javax.sql</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/xml/package-summary.html">javax.xml</a></li> <li class="api apilevel-8"> <a href="../../../reference/javax/xml/datatype/package-summary.html">javax.xml.datatype</a></li> <li class="api apilevel-8"> <a href="../../../reference/javax/xml/namespace/package-summary.html">javax.xml.namespace</a></li> <li class="api apilevel-1"> <a href="../../../reference/javax/xml/parsers/package-summary.html">javax.xml.parsers</a></li> <li class="api apilevel-8"> <a href="../../../reference/javax/xml/transform/package-summary.html">javax.xml.transform</a></li> <li class="api apilevel-8"> <a href="../../../reference/javax/xml/transform/dom/package-summary.html">javax.xml.transform.dom</a></li> <li class="api apilevel-8"> <a href="../../../reference/javax/xml/transform/sax/package-summary.html">javax.xml.transform.sax</a></li> <li class="api apilevel-8"> <a href="../../../reference/javax/xml/transform/stream/package-summary.html">javax.xml.transform.stream</a></li> <li class="api apilevel-8"> <a href="../../../reference/javax/xml/validation/package-summary.html">javax.xml.validation</a></li> <li class="api apilevel-8"> <a href="../../../reference/javax/xml/xpath/package-summary.html">javax.xml.xpath</a></li> <li class="api apilevel-1"> <a href="../../../reference/junit/framework/package-summary.html">junit.framework</a></li> <li class="api apilevel-1"> <a href="../../../reference/junit/runner/package-summary.html">junit.runner</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/package-summary.html">org.apache.http</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/auth/package-summary.html">org.apache.http.auth</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/auth/params/package-summary.html">org.apache.http.auth.params</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/client/package-summary.html">org.apache.http.client</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/client/entity/package-summary.html">org.apache.http.client.entity</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/client/methods/package-summary.html">org.apache.http.client.methods</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/client/params/package-summary.html">org.apache.http.client.params</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/client/protocol/package-summary.html">org.apache.http.client.protocol</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/client/utils/package-summary.html">org.apache.http.client.utils</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/conn/package-summary.html">org.apache.http.conn</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/conn/params/package-summary.html">org.apache.http.conn.params</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/conn/routing/package-summary.html">org.apache.http.conn.routing</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/conn/scheme/package-summary.html">org.apache.http.conn.scheme</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/conn/ssl/package-summary.html">org.apache.http.conn.ssl</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/conn/util/package-summary.html">org.apache.http.conn.util</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/cookie/package-summary.html">org.apache.http.cookie</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/cookie/params/package-summary.html">org.apache.http.cookie.params</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/entity/package-summary.html">org.apache.http.entity</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/impl/package-summary.html">org.apache.http.impl</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/impl/auth/package-summary.html">org.apache.http.impl.auth</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/impl/client/package-summary.html">org.apache.http.impl.client</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/impl/conn/package-summary.html">org.apache.http.impl.conn</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/impl/conn/tsccm/package-summary.html">org.apache.http.impl.conn.tsccm</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/impl/cookie/package-summary.html">org.apache.http.impl.cookie</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/impl/entity/package-summary.html">org.apache.http.impl.entity</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/impl/io/package-summary.html">org.apache.http.impl.io</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/io/package-summary.html">org.apache.http.io</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/message/package-summary.html">org.apache.http.message</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/params/package-summary.html">org.apache.http.params</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/protocol/package-summary.html">org.apache.http.protocol</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/apache/http/util/package-summary.html">org.apache.http.util</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/json/package-summary.html">org.json</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/w3c/dom/package-summary.html">org.w3c.dom</a></li> <li class="api apilevel-8"> <a href="../../../reference/org/w3c/dom/ls/package-summary.html">org.w3c.dom.ls</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/xml/sax/package-summary.html">org.xml.sax</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/xml/sax/ext/package-summary.html">org.xml.sax.ext</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/xml/sax/helpers/package-summary.html">org.xml.sax.helpers</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/xmlpull/v1/package-summary.html">org.xmlpull.v1</a></li> <li class="api apilevel-1"> <a href="../../../reference/org/xmlpull/v1/sax2/package-summary.html">org.xmlpull.v1.sax2</a></li> </ul><br/> </div> <!-- end packages-nav --> </div> <!-- end resize-packages --> <div id="classes-nav" class="scroll-pane"> <ul> <li><h2>Interfaces</h2> <ul> <li class="api apilevel-1"><a href="../../../reference/java/lang/Appendable.html">Appendable</a></li> <li class="api apilevel-19"><a href="../../../reference/java/lang/AutoCloseable.html">AutoCloseable</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/CharSequence.html">CharSequence</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Cloneable.html">Cloneable</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Comparable.html">Comparable</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Iterable.html">Iterable</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Readable.html">Readable</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Runnable.html">Runnable</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Thread.UncaughtExceptionHandler.html">Thread.UncaughtExceptionHandler</a></li> </ul> </li> <li><h2>Classes</h2> <ul> <li class="api apilevel-1"><a href="../../../reference/java/lang/Boolean.html">Boolean</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Byte.html">Byte</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Character.html">Character</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Character.Subset.html">Character.Subset</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Character.UnicodeBlock.html">Character.UnicodeBlock</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Class.html">Class</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ClassLoader.html">ClassLoader</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Compiler.html">Compiler</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Double.html">Double</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Enum.html">Enum</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Float.html">Float</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/InheritableThreadLocal.html">InheritableThreadLocal</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Integer.html">Integer</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Long.html">Long</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Math.html">Math</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Number.html">Number</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Object.html">Object</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Package.html">Package</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Process.html">Process</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ProcessBuilder.html">ProcessBuilder</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Runtime.html">Runtime</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/RuntimePermission.html">RuntimePermission</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/SecurityManager.html">SecurityManager</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Short.html">Short</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/StackTraceElement.html">StackTraceElement</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/StrictMath.html">StrictMath</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/String.html">String</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/StringBuffer.html">StringBuffer</a></li> <li class="selected api apilevel-1"><a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/System.html">System</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Thread.html">Thread</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ThreadGroup.html">ThreadGroup</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ThreadLocal.html">ThreadLocal</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Throwable.html">Throwable</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Void.html">Void</a></li> </ul> </li> <li><h2>Enums</h2> <ul> <li class="api apilevel-1"><a href="../../../reference/java/lang/Thread.State.html">Thread.State</a></li> </ul> </li> <li><h2>Exceptions</h2> <ul> <li class="api apilevel-1"><a href="../../../reference/java/lang/ArithmeticException.html">ArithmeticException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ArrayStoreException.html">ArrayStoreException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ClassCastException.html">ClassCastException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ClassNotFoundException.html">ClassNotFoundException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/CloneNotSupportedException.html">CloneNotSupportedException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/EnumConstantNotPresentException.html">EnumConstantNotPresentException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Exception.html">Exception</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalAccessException.html">IllegalAccessException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalArgumentException.html">IllegalArgumentException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalMonitorStateException.html">IllegalMonitorStateException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalStateException.html">IllegalStateException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalThreadStateException.html">IllegalThreadStateException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/InstantiationException.html">InstantiationException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/InterruptedException.html">InterruptedException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/NegativeArraySizeException.html">NegativeArraySizeException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/NoSuchFieldException.html">NoSuchFieldException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/NoSuchMethodException.html">NoSuchMethodException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/NullPointerException.html">NullPointerException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/NumberFormatException.html">NumberFormatException</a></li> <li class="api apilevel-19"><a href="../../../reference/java/lang/ReflectiveOperationException.html">ReflectiveOperationException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/RuntimeException.html">RuntimeException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/SecurityException.html">SecurityException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/TypeNotPresentException.html">TypeNotPresentException</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/UnsupportedOperationException.html">UnsupportedOperationException</a></li> </ul> </li> <li><h2>Errors</h2> <ul> <li class="api apilevel-1"><a href="../../../reference/java/lang/AbstractMethodError.html">AbstractMethodError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/AssertionError.html">AssertionError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ClassCircularityError.html">ClassCircularityError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ClassFormatError.html">ClassFormatError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/Error.html">Error</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ExceptionInInitializerError.html">ExceptionInInitializerError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/IllegalAccessError.html">IllegalAccessError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/IncompatibleClassChangeError.html">IncompatibleClassChangeError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/InstantiationError.html">InstantiationError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/InternalError.html">InternalError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/LinkageError.html">LinkageError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/NoClassDefFoundError.html">NoClassDefFoundError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/NoSuchFieldError.html">NoSuchFieldError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/NoSuchMethodError.html">NoSuchMethodError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/OutOfMemoryError.html">OutOfMemoryError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/StackOverflowError.html">StackOverflowError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/ThreadDeath.html">ThreadDeath</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/UnknownError.html">UnknownError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/UnsatisfiedLinkError.html">UnsatisfiedLinkError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/UnsupportedClassVersionError.html">UnsupportedClassVersionError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/VerifyError.html">VerifyError</a></li> <li class="api apilevel-1"><a href="../../../reference/java/lang/VirtualMachineError.html">VirtualMachineError</a></li> </ul> </li> </ul><br/> </div><!-- end classes --> </div><!-- end nav-panels --> <div id="nav-tree" style="display:none" class="scroll-pane"> <div id="tree-list"></div> </div><!-- end nav-tree --> </div><!-- end swapper --> <div id="nav-swap"> <a class="fullscreen">fullscreen</a> <a href='#' onclick='swapNav();return false;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a> </div> </div> <!-- end devdoc-nav --> </div> <!-- end side-nav --> <script type="text/javascript"> // init fullscreen based on user pref var fullscreen = readCookie("fullscreen"); if (fullscreen != 0) { if (fullscreen == "false") { toggleFullscreen(false); } else { toggleFullscreen(true); } } // init nav version for mobile if (isMobile) { swapNav(); // tree view should be used on mobile $('#nav-swap').hide(); } else { chooseDefaultNav(); if ($("#nav-tree").is(':visible')) { init_default_navtree("../../../"); } } // scroll the selected page into view $(document).ready(function() { scrollIntoView("packages-nav"); scrollIntoView("classes-nav"); }); </script> <div class="col-12" id="doc-col"> <div id="api-info-block"> <div class="sum-details-links"> Summary: <a href="#pubctors">Ctors</a> &#124; <a href="#pubmethods">Methods</a> &#124; <a href="#inhmethods">Inherited Methods</a> &#124; <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> </div><!-- end sum-details-links --> <div class="api-level"> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a> </div> </div><!-- end api-info-block --> <!-- ======== START OF CLASS DATA ======== --> <div id="jd-header"> public final class <h1 itemprop="name">StringBuilder</h1> extends <a href="../../../reference/java/lang/Object.html">Object</a><br/> implements <a href="../../../reference/java/io/Serializable.html">Serializable</a> <a href="../../../reference/java/lang/Appendable.html">Appendable</a> <a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> </div><!-- end header --> <div id="naMessage"></div> <div id="jd-content" class="api apilevel-1"> <table class="jd-inheritance-table"> <tr> <td colspan="2" class="jd-inheritance-class-cell"><a href="../../../reference/java/lang/Object.html">java.lang.Object</a></td> </tr> <tr> <td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;&#x21b3;</td> <td colspan="1" class="jd-inheritance-class-cell">java.lang.StringBuilder</td> </tr> </table> <div class="jd-descr"> <h2>Class Overview</h2> <p itemprop="articleBody">A modifiable <code><a href="../../../reference/java/lang/CharSequence.html">sequence of characters</a></code> for use in creating strings. This class is intended as a direct replacement of <code><a href="../../../reference/java/lang/StringBuffer.html">StringBuffer</a></code> for non-concurrent use; unlike <code>StringBuffer</code> this class is not synchronized. <p>For particularly complex string-building needs, consider <code><a href="../../../reference/java/util/Formatter.html">Formatter</a></code>. <p>The majority of the modification methods on this class return <code>this</code> so that method calls can be chained together. For example: <code>new StringBuilder("a").append("b").append("c").toString()</code>.</p> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/CharSequence.html">CharSequence</a></code></li><li><code><a href="../../../reference/java/lang/Appendable.html">Appendable</a></code></li><li><code><a href="../../../reference/java/lang/StringBuffer.html">StringBuffer</a></code></li><li><code><a href="../../../reference/java/lang/String.html">String</a></code></li><li><code><a href="../../../reference/java/lang/String.html#format(java.lang.String, java.lang.Object...)">format(String, Object...)</a></code></li> </ul> </div> </div><!-- jd-descr --> <div class="jd-descr"> <h2>Summary</h2> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> </nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#StringBuilder()">StringBuilder</a></span>()</nobr> <div class="jd-descrdiv">Constructs an instance with an initial capacity of <code>16</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> </nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#StringBuilder(int)">StringBuilder</a></span>(int capacity)</nobr> <div class="jd-descrdiv">Constructs an instance with the specified capacity.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> </nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#StringBuilder(java.lang.CharSequence)">StringBuilder</a></span>(<a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> seq)</nobr> <div class="jd-descrdiv">Constructs an instance that's initialized with the contents of the specified <code>CharSequence</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> </nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#StringBuilder(java.lang.String)">StringBuilder</a></span>(<a href="../../../reference/java/lang/String.html">String</a> str)</nobr> <div class="jd-descrdiv">Constructs an instance that's initialized with the contents of the specified <code>String</code>.</div> </td></tr> </table> <!-- ========== METHOD SUMMARY =========== --> <table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(char[], int, int)">append</a></span>(char[] str, int offset, int len)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified subset of the <code>char[]</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(double)">append</a></span>(double d)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified <code>double</code> value.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(long)">append</a></span>(long l)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified <code>long</code> value.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(boolean)">append</a></span>(boolean b)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified <code>boolean</code> value.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(float)">append</a></span>(float f)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified <code>float</code> value.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(char[])">append</a></span>(char[] chars)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified <code>char[]</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(int)">append</a></span>(int i)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified <code>int</code> value.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(java.lang.StringBuffer)">append</a></span>(<a href="../../../reference/java/lang/StringBuffer.html">StringBuffer</a> sb)</nobr> <div class="jd-descrdiv">Appends the contents of the specified <code>StringBuffer</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(java.lang.CharSequence)">append</a></span>(<a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> csq)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified <code>CharSequence</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(char)">append</a></span>(char c)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified <code>char</code> value.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(java.lang.String)">append</a></span>(<a href="../../../reference/java/lang/String.html">String</a> str)</nobr> <div class="jd-descrdiv">Appends the contents of the specified string.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(java.lang.CharSequence, int, int)">append</a></span>(<a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> csq, int start, int end)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified subsequence of the <code>CharSequence</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#append(java.lang.Object)">append</a></span>(<a href="../../../reference/java/lang/Object.html">Object</a> obj)</nobr> <div class="jd-descrdiv">Appends the string representation of the specified <code>Object</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#appendCodePoint(int)">appendCodePoint</a></span>(int codePoint)</nobr> <div class="jd-descrdiv">Appends the encoded Unicode code point.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#capacity()">capacity</a></span>()</nobr> <div class="jd-descrdiv">Returns the number of characters that can be held without growing.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> char</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#charAt(int)">charAt</a></span>(int index)</nobr> <div class="jd-descrdiv">Retrieves the character at the <code>index</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#codePointAt(int)">codePointAt</a></span>(int index)</nobr> <div class="jd-descrdiv">Retrieves the Unicode code point value at the <code>index</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#codePointBefore(int)">codePointBefore</a></span>(int index)</nobr> <div class="jd-descrdiv">Retrieves the Unicode code point value that precedes the <code>index</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#codePointCount(int, int)">codePointCount</a></span>(int start, int end)</nobr> <div class="jd-descrdiv">Calculates the number of Unicode code points between <code>start</code> and <code>end</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#delete(int, int)">delete</a></span>(int start, int end)</nobr> <div class="jd-descrdiv">Deletes a sequence of characters specified by <code>start</code> and <code>end</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#deleteCharAt(int)">deleteCharAt</a></span>(int index)</nobr> <div class="jd-descrdiv">Deletes the character at the specified index.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#ensureCapacity(int)">ensureCapacity</a></span>(int min)</nobr> <div class="jd-descrdiv">Ensures that this object has a minimum capacity available before requiring the internal buffer to be enlarged.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#getChars(int, int, char[], int)">getChars</a></span>(int start, int end, char[] dst, int dstStart)</nobr> <div class="jd-descrdiv">Copies the requested sequence of characters into <code>dst</code> passed starting at <code>dst</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#indexOf(java.lang.String, int)">indexOf</a></span>(<a href="../../../reference/java/lang/String.html">String</a> subString, int start)</nobr> <div class="jd-descrdiv">Searches for the index of the specified character.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#indexOf(java.lang.String)">indexOf</a></span>(<a href="../../../reference/java/lang/String.html">String</a> string)</nobr> <div class="jd-descrdiv">Searches for the first index of the specified character.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, java.lang.CharSequence, int, int)">insert</a></span>(int offset, <a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> s, int start, int end)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified subsequence of the <code>CharSequence</code> at the specified <code>offset</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, int)">insert</a></span>(int offset, int i)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified <code>int</code> value at the specified <code>offset</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, double)">insert</a></span>(int offset, double d)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified <code>double</code> value at the specified <code>offset</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, char[], int, int)">insert</a></span>(int offset, char[] str, int strOffset, int strLen)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified subsequence of the <code>char[]</code> at the specified <code>offset</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, java.lang.String)">insert</a></span>(int offset, <a href="../../../reference/java/lang/String.html">String</a> str)</nobr> <div class="jd-descrdiv">Inserts the specified string at the specified <code>offset</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, long)">insert</a></span>(int offset, long l)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified <code>long</code> value at the specified <code>offset</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, java.lang.Object)">insert</a></span>(int offset, <a href="../../../reference/java/lang/Object.html">Object</a> obj)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified <code>Object</code> at the specified <code>offset</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, float)">insert</a></span>(int offset, float f)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified <code>float</code> value at the specified <code>offset</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, char)">insert</a></span>(int offset, char c)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified <code>char</code> value at the specified <code>offset</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, char[])">insert</a></span>(int offset, char[] ch)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified <code>char[]</code> at the specified <code>offset</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, java.lang.CharSequence)">insert</a></span>(int offset, <a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> s)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified <code>CharSequence</code> at the specified <code>offset</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#insert(int, boolean)">insert</a></span>(int offset, boolean b)</nobr> <div class="jd-descrdiv">Inserts the string representation of the specified <code>boolean</code> value at the specified <code>offset</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#lastIndexOf(java.lang.String)">lastIndexOf</a></span>(<a href="../../../reference/java/lang/String.html">String</a> string)</nobr> <div class="jd-descrdiv">Searches for the last index of the specified character.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#lastIndexOf(java.lang.String, int)">lastIndexOf</a></span>(<a href="../../../reference/java/lang/String.html">String</a> subString, int start)</nobr> <div class="jd-descrdiv">Searches for the index of the specified character.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#length()">length</a></span>()</nobr> <div class="jd-descrdiv">The current length.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#offsetByCodePoints(int, int)">offsetByCodePoints</a></span>(int index, int codePointOffset)</nobr> <div class="jd-descrdiv">Returns the index that is offset <code>codePointOffset</code> code points from <code>index</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#replace(int, int, java.lang.String)">replace</a></span>(int start, int end, <a href="../../../reference/java/lang/String.html">String</a> string)</nobr> <div class="jd-descrdiv">Replaces the specified subsequence in this builder with the specified string.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#reverse()">reverse</a></span>()</nobr> <div class="jd-descrdiv">Reverses the order of characters in this builder.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#setCharAt(int, char)">setCharAt</a></span>(int index, char ch)</nobr> <div class="jd-descrdiv">Sets the character at the <code>index</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#setLength(int)">setLength</a></span>(int length)</nobr> <div class="jd-descrdiv">Sets the current length to a new value.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/CharSequence.html">CharSequence</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#subSequence(int, int)">subSequence</a></span>(int start, int end)</nobr> <div class="jd-descrdiv">Returns a <code>CharSequence</code> of the subsequence from the <code>start</code> index to the <code>end</code> index.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/String.html">String</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#substring(int)">substring</a></span>(int start)</nobr> <div class="jd-descrdiv">Returns the String value of the subsequence from the <code>start</code> index to the current end.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/String.html">String</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#substring(int, int)">substring</a></span>(int start, int end)</nobr> <div class="jd-descrdiv">Returns the String value of the subsequence from the <code>start</code> index to the <code>end</code> index.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/String.html">String</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#toString()">toString</a></span>()</nobr> <div class="jd-descrdiv">Returns the contents of this builder.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/StringBuilder.html#trimToSize()">trimToSize</a></span>()</nobr> <div class="jd-descrdiv">Trims off any extra capacity beyond the current length.</div> </td></tr> </table> <!-- ========== METHOD SUMMARY =========== --> <table id="inhmethods" class="jd-sumtable"><tr><th> <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> <div style="clear:left;">Inherited Methods</div></th></tr> <tr class="api apilevel-" > <td colspan="12"> <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" ><img id="inherited-methods-java.lang.Object-trigger" src="../../../assets/images/triangle-closed.png" class="jd-expando-trigger-img" /></a> From class <a href="../../../reference/java/lang/Object.html">java.lang.Object</a> <div id="inherited-methods-java.lang.Object"> <div id="inherited-methods-java.lang.Object-list" class="jd-inheritedlinks"> </div> <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> <table class="jd-sumtable-expando"> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/Object.html">Object</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#clone()">clone</a></span>()</nobr> <div class="jd-descrdiv">Creates and returns a copy of this <code>Object</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> boolean</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#equals(java.lang.Object)">equals</a></span>(<a href="../../../reference/java/lang/Object.html">Object</a> o)</nobr> <div class="jd-descrdiv">Compares this instance with the specified object and indicates if they are equal.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#finalize()">finalize</a></span>()</nobr> <div class="jd-descrdiv">Invoked when the garbage collector has detected that this instance is no longer reachable.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> final <a href="../../../reference/java/lang/Class.html">Class</a>&lt;?&gt;</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#getClass()">getClass</a></span>()</nobr> <div class="jd-descrdiv">Returns the unique instance of <code><a href="../../../reference/java/lang/Class.html">Class</a></code> that represents this object's class.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#hashCode()">hashCode</a></span>()</nobr> <div class="jd-descrdiv">Returns an integer hash code for this object.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> final void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#notify()">notify</a></span>()</nobr> <div class="jd-descrdiv">Causes a thread which is waiting on this object's monitor (by means of calling one of the <code>wait()</code> methods) to be woken up.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> final void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#notifyAll()">notifyAll</a></span>()</nobr> <div class="jd-descrdiv">Causes all threads which are waiting on this object's monitor (by means of calling one of the <code>wait()</code> methods) to be woken up.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> <a href="../../../reference/java/lang/String.html">String</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#toString()">toString</a></span>()</nobr> <div class="jd-descrdiv">Returns a string containing a concise, human-readable description of this object.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> final void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#wait()">wait</a></span>()</nobr> <div class="jd-descrdiv">Causes the calling thread to wait until another thread calls the <code>notify()</code> or <code>notifyAll()</code> method of this object.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> final void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#wait(long, int)">wait</a></span>(long millis, int nanos)</nobr> <div class="jd-descrdiv">Causes the calling thread to wait until another thread calls the <code>notify()</code> or <code>notifyAll()</code> method of this object or until the specified timeout expires.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> final void</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Object.html#wait(long)">wait</a></span>(long millis)</nobr> <div class="jd-descrdiv">Causes the calling thread to wait until another thread calls the <code>notify()</code> or <code>notifyAll()</code> method of this object or until the specified timeout expires.</div> </td></tr> </table> </div> </div> </td></tr> <tr class="api apilevel-" > <td colspan="12"> <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Appendable" class="jd-expando-trigger closed" ><img id="inherited-methods-java.lang.Appendable-trigger" src="../../../assets/images/triangle-closed.png" class="jd-expando-trigger-img" /></a> From interface <a href="../../../reference/java/lang/Appendable.html">java.lang.Appendable</a> <div id="inherited-methods-java.lang.Appendable"> <div id="inherited-methods-java.lang.Appendable-list" class="jd-inheritedlinks"> </div> <div id="inherited-methods-java.lang.Appendable-summary" style="display: none;"> <table class="jd-sumtable-expando"> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> abstract <a href="../../../reference/java/lang/Appendable.html">Appendable</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Appendable.html#append(java.lang.CharSequence)">append</a></span>(<a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> csq)</nobr> <div class="jd-descrdiv">Appends the character sequence <code>csq</code>.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> abstract <a href="../../../reference/java/lang/Appendable.html">Appendable</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Appendable.html#append(java.lang.CharSequence, int, int)">append</a></span>(<a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> csq, int start, int end)</nobr> <div class="jd-descrdiv">Appends a subsequence of <code>csq</code>.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> abstract <a href="../../../reference/java/lang/Appendable.html">Appendable</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/Appendable.html#append(char)">append</a></span>(char c)</nobr> <div class="jd-descrdiv">Appends the specified character.</div> </td></tr> </table> </div> </div> </td></tr> <tr class="api apilevel-" > <td colspan="12"> <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.CharSequence" class="jd-expando-trigger closed" ><img id="inherited-methods-java.lang.CharSequence-trigger" src="../../../assets/images/triangle-closed.png" class="jd-expando-trigger-img" /></a> From interface <a href="../../../reference/java/lang/CharSequence.html">java.lang.CharSequence</a> <div id="inherited-methods-java.lang.CharSequence"> <div id="inherited-methods-java.lang.CharSequence-list" class="jd-inheritedlinks"> </div> <div id="inherited-methods-java.lang.CharSequence-summary" style="display: none;"> <table class="jd-sumtable-expando"> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> abstract char</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/CharSequence.html#charAt(int)">charAt</a></span>(int index)</nobr> <div class="jd-descrdiv">Returns the character at the specified index, with the first character having index zero.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> abstract int</nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/CharSequence.html#length()">length</a></span>()</nobr> <div class="jd-descrdiv">Returns the number of characters in this sequence.</div> </td></tr> <tr class="alt-color api apilevel-1" > <td class="jd-typecol"><nobr> abstract <a href="../../../reference/java/lang/CharSequence.html">CharSequence</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/CharSequence.html#subSequence(int, int)">subSequence</a></span>(int start, int end)</nobr> <div class="jd-descrdiv">Returns a <code>CharSequence</code> from the <code>start</code> index (inclusive) to the <code>end</code> index (exclusive) of this sequence.</div> </td></tr> <tr class=" api apilevel-1" > <td class="jd-typecol"><nobr> abstract <a href="../../../reference/java/lang/String.html">String</a></nobr> </td> <td class="jd-linkcol" width="100%"><nobr> <span class="sympad"><a href="../../../reference/java/lang/CharSequence.html#toString()">toString</a></span>()</nobr> <div class="jd-descrdiv">Returns a string with the same characters in the same order as in this sequence.</div> </td></tr> </table> </div> </div> </td></tr> </table> </div><!-- jd-descr (summary) --> <!-- Details --> <!-- XML Attributes --> <!-- Enum Values --> <!-- Constants --> <!-- Fields --> <!-- Public ctors --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <h2>Public Constructors</h2> <A NAME="StringBuilder()"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public </span> <span class="sympad">StringBuilder</span> <span class="normal">()</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Constructs an instance with an initial capacity of <code>16</code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/StringBuilder.html#capacity()">capacity()</a></code></li> </ul> </div> </div> </div> <A NAME="StringBuilder(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public </span> <span class="sympad">StringBuilder</span> <span class="normal">(int capacity)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Constructs an instance with the specified capacity.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>capacity</td> <td>the initial capacity to use.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/NegativeArraySizeException.html">NegativeArraySizeException</a></td> <td>if the specified <code>capacity</code> is negative.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/StringBuilder.html#capacity()">capacity()</a></code></li> </ul> </div> </div> </div> <A NAME="StringBuilder(java.lang.CharSequence)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public </span> <span class="sympad">StringBuilder</span> <span class="normal">(<a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> seq)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Constructs an instance that's initialized with the contents of the specified <code>CharSequence</code>. The capacity of the new builder will be the length of the <code>CharSequence</code> plus 16.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>seq</td> <td>the <code>CharSequence</code> to copy into the builder.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/NullPointerException.html">NullPointerException</a></td> <td>if <code>seq</code> is <code>null</code>. </td> </tr> </table> </div> </div> </div> <A NAME="StringBuilder(java.lang.String)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public </span> <span class="sympad">StringBuilder</span> <span class="normal">(<a href="../../../reference/java/lang/String.html">String</a> str)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Constructs an instance that's initialized with the contents of the specified <code>String</code>. The capacity of the new builder will be the length of the <code>String</code> plus 16.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>str</td> <td>the <code>String</code> to copy into the builder.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/NullPointerException.html">NullPointerException</a></td> <td>if <code>str</code> is <code>null</code>. </td> </tr> </table> </div> </div> </div> <!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- Protected ctors --> <!-- ========= METHOD DETAIL ======== --> <!-- Public methdos --> <h2>Public Methods</h2> <A NAME="append(char[], int, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(char[] str, int offset, int len)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified subset of the <code>char[]</code>. The <code>char[]</code> value is converted to a String according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(char[], int, int)">valueOf(char[], int, int)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>str</td> <td>the <code>char[]</code> to append.</td> </tr> <tr> <th>offset</td> <td>the inclusive offset index.</td> </tr> <tr> <th>len</td> <td>the number of characters.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</a></td> <td>if <code>offset</code> and <code>len</code> do not specify a valid subsequence.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(char[], int, int)">valueOf(char[], int, int)</a></code></li> </ul> </div> </div> </div> <A NAME="append(double)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(double d)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified <code>double</code> value. The <code>double</code> value is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(double)">valueOf(double)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>d</td> <td>the <code>double</code> value to append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(double)">valueOf(double)</a></code></li> </ul> </div> </div> </div> <A NAME="append(long)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(long l)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified <code>long</code> value. The <code>long</code> value is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(long)">valueOf(long)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>l</td> <td>the <code>long</code> value.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(long)">valueOf(long)</a></code></li> </ul> </div> </div> </div> <A NAME="append(boolean)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(boolean b)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified <code>boolean</code> value. The <code>boolean</code> value is converted to a String according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(boolean)">valueOf(boolean)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>b</td> <td>the <code>boolean</code> value to append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(boolean)">valueOf(boolean)</a></code></li> </ul> </div> </div> </div> <A NAME="append(float)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(float f)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified <code>float</code> value. The <code>float</code> value is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(float)">valueOf(float)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>f</td> <td>the <code>float</code> value to append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(float)">valueOf(float)</a></code></li> </ul> </div> </div> </div> <A NAME="append(char[])"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(char[] chars)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified <code>char[]</code>. The <code>char[]</code> is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(char[])">valueOf(char[])</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>chars</td> <td>the <code>char[]</code> to append..</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(char[])">valueOf(char[])</a></code></li> </ul> </div> </div> </div> <A NAME="append(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(int i)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified <code>int</code> value. The <code>int</code> value is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(int)">valueOf(int)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>i</td> <td>the <code>int</code> value to append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(int)">valueOf(int)</a></code></li> </ul> </div> </div> </div> <A NAME="append(java.lang.StringBuffer)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(<a href="../../../reference/java/lang/StringBuffer.html">StringBuffer</a> sb)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the contents of the specified <code>StringBuffer</code>. If the StringBuffer is <code>null</code>, then the string <code>"null"</code> is appended.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>sb</td> <td>the <code>StringBuffer</code> to append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder. </li></ul> </div> </div> </div> <A NAME="append(java.lang.CharSequence)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(<a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> csq)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified <code>CharSequence</code>. If the <code>CharSequence</code> is <code>null</code>, then the string <code>"null"</code> is appended.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>csq</td> <td>the <code>CharSequence</code> to append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder. </li></ul> </div> </div> </div> <A NAME="append(char)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(char c)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified <code>char</code> value. The <code>char</code> value is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(char)">valueOf(char)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>c</td> <td>the <code>char</code> value to append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(char)">valueOf(char)</a></code></li> </ul> </div> </div> </div> <A NAME="append(java.lang.String)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(<a href="../../../reference/java/lang/String.html">String</a> str)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the contents of the specified string. If the string is <code>null</code>, then the string <code>"null"</code> is appended.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>str</td> <td>the string to append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder. </li></ul> </div> </div> </div> <A NAME="append(java.lang.CharSequence, int, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(<a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> csq, int start, int end)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified subsequence of the <code>CharSequence</code>. If the <code>CharSequence</code> is <code>null</code>, then the string <code>"null"</code> is used to extract the subsequence from.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>csq</td> <td>the <code>CharSequence</code> to append.</td> </tr> <tr> <th>start</td> <td>the beginning index.</td> </tr> <tr> <th>end</td> <td>the ending index.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>start</code> or <code>end</code> are negative, <code>start</code> is greater than <code>end</code> or <code>end</code> is greater than the length of <code>csq</code>. </td> </tr> </table> </div> </div> </div> <A NAME="append(java.lang.Object)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">append</span> <span class="normal">(<a href="../../../reference/java/lang/Object.html">Object</a> obj)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the string representation of the specified <code>Object</code>. The <code>Object</code> value is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(java.lang.Object)">valueOf(Object)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>obj</td> <td>the <code>Object</code> to append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(java.lang.Object)">valueOf(Object)</a></code></li> </ul> </div> </div> </div> <A NAME="appendCodePoint(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">appendCodePoint</span> <span class="normal">(int codePoint)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Appends the encoded Unicode code point. The code point is converted to a <code>char[]</code> as defined by <code><a href="../../../reference/java/lang/Character.html#toChars(int)">toChars(int)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>codePoint</td> <td>the Unicode code point to encode and append.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/Character.html#toChars(int)">toChars(int)</a></code></li> </ul> </div> </div> </div> <A NAME="capacity()"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">capacity</span> <span class="normal">()</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Returns the number of characters that can be held without growing.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the capacity</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/StringBuilder.html#ensureCapacity(int)">ensureCapacity(int)</a></code></li><li><code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code></li> </ul> </div> </div> </div> <A NAME="charAt(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public char </span> <span class="sympad">charAt</span> <span class="normal">(int index)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Retrieves the character at the <code>index</code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>index</td> <td>the index of the character to retrieve.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the char value.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>index</code> is negative or greater than or equal to the current <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code>. </td> </tr> </table> </div> </div> </div> <A NAME="codePointAt(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">codePointAt</span> <span class="normal">(int index)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Retrieves the Unicode code point value at the <code>index</code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>index</td> <td>the index to the <code>char</code> code unit.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the Unicode code point value.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>index</code> is negative or greater than or equal to <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/Character.html">Character</a></code></li><li><code><a href="../../../reference/java/lang/Character.html#codePointAt(char[], int, int)">codePointAt(char[], int, int)</a></code></li> </ul> </div> </div> </div> <A NAME="codePointBefore(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">codePointBefore</span> <span class="normal">(int index)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Retrieves the Unicode code point value that precedes the <code>index</code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>index</td> <td>the index to the <code>char</code> code unit within this object.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the Unicode code point value.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>index</code> is less than 1 or greater than <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/Character.html">Character</a></code></li><li><code><a href="../../../reference/java/lang/Character.html#codePointBefore(char[], int, int)">codePointBefore(char[], int, int)</a></code></li> </ul> </div> </div> </div> <A NAME="codePointCount(int, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">codePointCount</span> <span class="normal">(int start, int end)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Calculates the number of Unicode code points between <code>start</code> and <code>end</code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>start</td> <td>the inclusive beginning index of the subsequence.</td> </tr> <tr> <th>end</td> <td>the exclusive end index of the subsequence.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the number of Unicode code points in the subsequence.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>start</code> is negative or greater than <code>end</code> or <code>end</code> is greater than <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/Character.html">Character</a></code></li><li><code><a href="../../../reference/java/lang/Character.html#codePointCount(char[], int, int)">codePointCount(char[], int, int)</a></code></li> </ul> </div> </div> </div> <A NAME="delete(int, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">delete</span> <span class="normal">(int start, int end)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Deletes a sequence of characters specified by <code>start</code> and <code>end</code>. Shifts any remaining characters to the left.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>start</td> <td>the inclusive start index.</td> </tr> <tr> <th>end</td> <td>the exclusive end index.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>start</code> is less than zero, greater than the current length or greater than <code>end</code>. </td> </tr> </table> </div> </div> </div> <A NAME="deleteCharAt(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">deleteCharAt</span> <span class="normal">(int index)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Deletes the character at the specified index. shifts any remaining characters to the left.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>index</td> <td>the index of the character to delete.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>index</code> is less than zero or is greater than or equal to the current length. </td> </tr> </table> </div> </div> </div> <A NAME="ensureCapacity(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public void </span> <span class="sympad">ensureCapacity</span> <span class="normal">(int min)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Ensures that this object has a minimum capacity available before requiring the internal buffer to be enlarged. The general policy of this method is that if the <code>minimumCapacity</code> is larger than the current <code><a href="../../../reference/java/lang/StringBuilder.html#capacity()">capacity()</a></code>, then the capacity will be increased to the largest value of either the <code>minimumCapacity</code> or the current capacity multiplied by two plus two. Although this is the general policy, there is no guarantee that the capacity will change.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>min</td> <td>the new minimum capacity to set. </td> </tr> </table> </div> </div> </div> <A NAME="getChars(int, int, char[], int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public void </span> <span class="sympad">getChars</span> <span class="normal">(int start, int end, char[] dst, int dstStart)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Copies the requested sequence of characters into <code>dst</code> passed starting at <code>dst</code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>start</td> <td>the inclusive start index of the characters to copy.</td> </tr> <tr> <th>end</td> <td>the exclusive end index of the characters to copy.</td> </tr> <tr> <th>dst</td> <td>the <code>char[]</code> to copy the characters to.</td> </tr> <tr> <th>dstStart</td> <td>the inclusive start index of <code>dst</code> to begin copying to.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if the <code>start</code> is negative, the <code>dstStart</code> is negative, the <code>start</code> is greater than <code>end</code>, the <code>end</code> is greater than the current <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code> or <code>dstStart + end - begin</code> is greater than <code>dst.length</code>. </td> </tr> </table> </div> </div> </div> <A NAME="indexOf(java.lang.String, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">indexOf</span> <span class="normal">(<a href="../../../reference/java/lang/String.html">String</a> subString, int start)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Searches for the index of the specified character. The search for the character starts at the specified offset and moves towards the end.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>subString</td> <td>the string to find.</td> </tr> <tr> <th>start</td> <td>the starting offset.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the index of the specified character, -1 if the character isn't found</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/StringBuilder.html#lastIndexOf(java.lang.String, int)">lastIndexOf(String, int)</a></code></li> </ul> </div> </div> </div> <A NAME="indexOf(java.lang.String)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">indexOf</span> <span class="normal">(<a href="../../../reference/java/lang/String.html">String</a> string)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Searches for the first index of the specified character. The search for the character starts at the beginning and moves towards the end.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>string</td> <td>the string to find.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the index of the specified character, -1 if the character isn't found.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/StringBuilder.html#lastIndexOf(java.lang.String)">lastIndexOf(String)</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, java.lang.CharSequence, int, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, <a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> s, int start, int end)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified subsequence of the <code>CharSequence</code> at the specified <code>offset</code>. The <code>CharSequence</code> is converted to a String as defined by <code><a href="../../../reference/java/lang/CharSequence.html#subSequence(int, int)">subSequence(int, int)</a></code>. If the <code>CharSequence</code> is <code>null</code>, then the string <code>"null"</code> is used to determine the subsequence.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>s</td> <td>the <code>CharSequence</code> to insert.</td> </tr> <tr> <th>start</td> <td>the start of the subsequence of the character sequence.</td> </tr> <tr> <th>end</td> <td>the end of the subsequence of the character sequence.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>, or <code>start</code> and <code>end</code> do not specify a valid subsequence.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/CharSequence.html#subSequence(int, int)">subSequence(int, int)</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, int i)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified <code>int</code> value at the specified <code>offset</code>. The <code>int</code> value is converted to a String according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(int)">valueOf(int)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>i</td> <td>the <code>int</code> value to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(int)">valueOf(int)</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, double)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, double d)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified <code>double</code> value at the specified <code>offset</code>. The <code>double</code> value is converted to a String according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(double)">valueOf(double)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>d</td> <td>the <code>double</code> value to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(double)">valueOf(double)</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, char[], int, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, char[] str, int strOffset, int strLen)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified subsequence of the <code>char[]</code> at the specified <code>offset</code>. The <code>char[]</code> value is converted to a String according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(char[], int, int)">valueOf(char[], int, int)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>str</td> <td>the <code>char[]</code> to insert.</td> </tr> <tr> <th>strOffset</td> <td>the inclusive index.</td> </tr> <tr> <th>strLen</td> <td>the number of characters.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>, or <code>strOffset</code> and <code>strLen</code> do not specify a valid subsequence.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(char[], int, int)">valueOf(char[], int, int)</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, java.lang.String)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, <a href="../../../reference/java/lang/String.html">String</a> str)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the specified string at the specified <code>offset</code>. If the specified string is null, then the String <code>"null"</code> is inserted.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>str</td> <td>the <code>String</code> to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>. </td> </tr> </table> </div> </div> </div> <A NAME="insert(int, long)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, long l)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified <code>long</code> value at the specified <code>offset</code>. The <code>long</code> value is converted to a String according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(long)">valueOf(long)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>l</td> <td>the <code>long</code> value to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current {code length()}.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(long)">valueOf(long)</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, java.lang.Object)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, <a href="../../../reference/java/lang/Object.html">Object</a> obj)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified <code>Object</code> at the specified <code>offset</code>. The <code>Object</code> value is converted to a String according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(java.lang.Object)">valueOf(Object)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>obj</td> <td>the <code>Object</code> to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(java.lang.Object)">valueOf(Object)</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, float)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, float f)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified <code>float</code> value at the specified <code>offset</code>. The <code>float</code> value is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(float)">valueOf(float)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>f</td> <td>the <code>float</code> value to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(float)">valueOf(float)</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, char)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, char c)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified <code>char</code> value at the specified <code>offset</code>. The <code>char</code> value is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(char)">valueOf(char)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>c</td> <td>the <code>char</code> value to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(char)">valueOf(char)</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, char[])"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, char[] ch)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified <code>char[]</code> at the specified <code>offset</code>. The <code>char[]</code> value is converted to a String according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(char[])">valueOf(char[])</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>ch</td> <td>the <code>char[]</code> to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(char[])">valueOf(char[])</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, java.lang.CharSequence)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, <a href="../../../reference/java/lang/CharSequence.html">CharSequence</a> s)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified <code>CharSequence</code> at the specified <code>offset</code>. The <code>CharSequence</code> is converted to a String as defined by <code><a href="../../../reference/java/lang/CharSequence.html#toString()">toString()</a></code>. If <code>s</code> is <code>null</code>, then the String <code>"null"</code> is inserted.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>s</td> <td>the <code>CharSequence</code> to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length()</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/CharSequence.html#toString()">toString()</a></code></li> </ul> </div> </div> </div> <A NAME="insert(int, boolean)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">insert</span> <span class="normal">(int offset, boolean b)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Inserts the string representation of the specified <code>boolean</code> value at the specified <code>offset</code>. The <code>boolean</code> value is converted to a string according to the rule defined by <code><a href="../../../reference/java/lang/String.html#valueOf(boolean)">valueOf(boolean)</a></code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>offset</td> <td>the index to insert at.</td> </tr> <tr> <th>b</td> <td>the <code>boolean</code> value to insert.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>offset</code> is negative or greater than the current <code>length</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#valueOf(boolean)">valueOf(boolean)</a></code></li> </ul> </div> </div> </div> <A NAME="lastIndexOf(java.lang.String)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">lastIndexOf</span> <span class="normal">(<a href="../../../reference/java/lang/String.html">String</a> string)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Searches for the last index of the specified character. The search for the character starts at the end and moves towards the beginning.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>string</td> <td>the string to find.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the index of the specified character, -1 if the character isn't found.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/NullPointerException.html">NullPointerException</a></td> <td>if <code>string</code> is <code>null</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#lastIndexOf(java.lang.String)">lastIndexOf(java.lang.String)</a></code></li> </ul> </div> </div> </div> <A NAME="lastIndexOf(java.lang.String, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">lastIndexOf</span> <span class="normal">(<a href="../../../reference/java/lang/String.html">String</a> subString, int start)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Searches for the index of the specified character. The search for the character starts at the specified offset and moves towards the beginning.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>subString</td> <td>the string to find.</td> </tr> <tr> <th>start</td> <td>the starting offset.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the index of the specified character, -1 if the character isn't found.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/NullPointerException.html">NullPointerException</a></td> <td>if <code>subString</code> is <code>null</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/String.html#lastIndexOf(java.lang.String, int)">lastIndexOf(String, int)</a></code></li> </ul> </div> </div> </div> <A NAME="length()"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">length</span> <span class="normal">()</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>The current length.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the number of characters contained in this instance. </li></ul> </div> </div> </div> <A NAME="offsetByCodePoints(int, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public int </span> <span class="sympad">offsetByCodePoints</span> <span class="normal">(int index, int codePointOffset)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Returns the index that is offset <code>codePointOffset</code> code points from <code>index</code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>index</td> <td>the index to calculate the offset from.</td> </tr> <tr> <th>codePointOffset</td> <td>the number of code points to count.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the index that is <code>codePointOffset</code> code points away from index.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>index</code> is negative or greater than <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code> or if there aren't enough code points before or after <code>index</code> to match <code>codePointOffset</code>.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">See Also</h5> <ul class="nolist"><li><code><a href="../../../reference/java/lang/Character.html">Character</a></code></li><li><code><a href="../../../reference/java/lang/Character.html#offsetByCodePoints(char[], int, int, int, int)">offsetByCodePoints(char[], int, int, int, int)</a></code></li> </ul> </div> </div> </div> <A NAME="replace(int, int, java.lang.String)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">replace</span> <span class="normal">(int start, int end, <a href="../../../reference/java/lang/String.html">String</a> string)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Replaces the specified subsequence in this builder with the specified string.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>start</td> <td>the inclusive begin index.</td> </tr> <tr> <th>end</td> <td>the exclusive end index.</td> </tr> <tr> <th>string</td> <td>the replacement string.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this builder.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>start</code> is negative, greater than the current <code>length()</code> or greater than <code>end</code>.</td> </tr> <tr> <th><a href="../../../reference/java/lang/NullPointerException.html">NullPointerException</a></td> <td>if <code>str</code> is <code>null</code>. </td> </tr> </table> </div> </div> </div> <A NAME="reverse()"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/StringBuilder.html">StringBuilder</a> </span> <span class="sympad">reverse</span> <span class="normal">()</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Reverses the order of characters in this builder.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>this buffer. </li></ul> </div> </div> </div> <A NAME="setCharAt(int, char)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public void </span> <span class="sympad">setCharAt</span> <span class="normal">(int index, char ch)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Sets the character at the <code>index</code>.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>index</td> <td>the zero-based index of the character to replace.</td> </tr> <tr> <th>ch</td> <td>the character to set.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/IndexOutOfBoundsException.html">IndexOutOfBoundsException</a></td> <td>if <code>index</code> is negative or greater than or equal to the current <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code>. </td> </tr> </table> </div> </div> </div> <A NAME="setLength(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public void </span> <span class="sympad">setLength</span> <span class="normal">(int length)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Sets the current length to a new value. If the new length is larger than the current length, then the new characters at the end of this object will contain the <code>char</code> value of <code>d</code> or if <code>end</code> is greater than the current <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code>.</td> </tr> </table> </div> </div> </div> <A NAME="substring(int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/String.html">String</a> </span> <span class="sympad">substring</span> <span class="normal">(int start)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Returns the String value of the subsequence from the <code>start</code> index to the current end.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>start</td> <td>the inclusive start index to begin the subsequence.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>a String containing the subsequence.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>start</code> is negative or greater than the current <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code>. </td> </tr> </table> </div> </div> </div> <A NAME="substring(int, int)"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/String.html">String</a> </span> <span class="sympad">substring</span> <span class="normal">(int start, int end)</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Returns the String value of the subsequence from the <code>start</code> index to the <code>end</code> index.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Parameters</h5> <table class="jd-tagtable"> <tr> <th>start</td> <td>the inclusive start index to begin the subsequence.</td> </tr> <tr> <th>end</td> <td>the exclusive end index to end the subsequence.</td> </tr> </table> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>a String containing the subsequence.</li></ul> </div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Throws</h5> <table class="jd-tagtable"> <tr> <th><a href="../../../reference/java/lang/StringIndexOutOfBoundsException.html">StringIndexOutOfBoundsException</a></td> <td>if <code>start</code> is negative, greater than <code>end</code> or if <code>end</code> is greater than the current <code><a href="../../../reference/java/lang/StringBuilder.html#length()">length()</a></code>. </td> </tr> </table> </div> </div> </div> <A NAME="toString()"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public <a href="../../../reference/java/lang/String.html">String</a> </span> <span class="sympad">toString</span> <span class="normal">()</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Returns the contents of this builder.</p></div> <div class="jd-tagdata"> <h5 class="jd-tagtitle">Returns</h5> <ul class="nolist"><li>the string representation of the data in this builder. </li></ul> </div> </div> </div> <A NAME="trimToSize()"></A> <div class="jd-details api apilevel-1"> <h4 class="jd-details-title"> <span class="normal"> public void </span> <span class="sympad">trimToSize</span> <span class="normal">()</span> </h4> <div class="api-level"> <div> Added in <a href="../../../guide/topics/manifest/uses-sdk-element.html#ApiLevels">API level 1</a></div> </div> <div class="jd-details-descr"> <div class="jd-tagdata jd-tagdescr"><p>Trims off any extra capacity beyond the current length. Note, this method is NOT guaranteed to change the capacity of this object.</p></div> </div> </div> <!-- ========= METHOD DETAIL ======== --> <!-- ========= END OF CLASS DATA ========= --> <A NAME="navbar_top"></A> <div id="footer" class="wrap" > <div id="copyright"> Except as noted, this content is licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>. For details and restrictions, see the <a href="../../../license.html"> Content License</a>. </div> <div id="build_info"> Android 4.4&nbsp;r1 &mdash; <script src="../../../timestamp.js" type="text/javascript"></script> <script>document.write(BUILD_TIMESTAMP)</script> </div> <div id="footerlinks"> <p> <a href="../../../about/index.html">About Android</a>&nbsp;&nbsp;|&nbsp; <a href="../../../legal.html">Legal</a>&nbsp;&nbsp;|&nbsp; <a href="../../../support.html">Support</a> </p> </div> </div> <!-- end footer --> </div> <!-- jd-content --> </div><!-- end doc-content --> </div> <!-- end body-content --> </body> </html>
AzureZhao/android-developer-cn
reference/java/lang/StringBuilder.html
HTML
mit
192,270
<?php namespace Nurix\SliderBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class Configuration implements ConfigurationInterface { /** * {@inheritDoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('nurix_slider'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for // more information on that topic. return $treeBuilder; } }
azamatus/afm
src/Nurix/SliderBundle/DependencyInjection/Configuration.php
PHP
mit
879
// // DPIRKitVirtualDeviceCreateDialog.h // dConnectDeviceIRKit // // Copyright (c) 2015 NTT DOCOMO, INC. // Released under the MIT license // http://opensource.org/licenses/mit-license.php // #import <UIKit/UIKit.h> #import "DPIRKitDialog.h" @interface DPIRKitVirtualDeviceCreateDialog : DPIRKitDialog<UITextFieldDelegate> +(void)showWithServiceId:(NSString*)serviceId categoryName:(NSString*)categoryName; @end
TakayukiHoshi1984/DeviceConnect-iOS
dConnectDevicePlugin/dConnectDeviceIRKit/dConnectDeviceIRKit/Classes/alert/DPIRKitVirtualDeviceCreateDialog.h
C
mit
437
question(q0,'Do you prefer lecture with English?'). question(q1,'Do you need scholarship?'). question(q2,'Is your GPA>=3.5?'). question(q3,'Do you have GRE score?'). question(q4,'Is your living cost higher US$6K?'). question(q5,'Is your living cost between US$4K and US$6K?'). question(q6,'Is your GPA between 3.0 and 3.5?'). question(q7,'Is your IELTS > 6.0?'). question(q8,'Is the tuition fee higher than USD$25K?'). process0(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q0, Answer ), ( Answer = yes -> process1(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V); Answer = no -> data(A,'Asia',C,D,E,F,G,H,I,J,K,L,M,N,O,'Korean',Q,R,S,T,U,V)| data(A,'Asia',C,D,E,F,G,H,I,J,K,L,M,N,O,'Chinese',Q,R,S,T,U,V)| data(A,'Asia',C,D,E,F,G,H,I,J,K,L,M,N,O,'Hebrew',Q,R,S,T,U,V)| data(A,'Asia',C,D,E,F,G,H,I,J,K,L,M,N,O,'Japanese',Q,R,S,T,U,V) ). process1(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q1, Answer ), ( Answer = yes -> process2(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V); Answer = no -> process11(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) ). process2(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q2, Answer ), ( Answer = yes -> process3(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V); Answer = no -> process6(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) ). process3(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q3, Answer ), ( Answer = yes -> process4(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V); Answer = no -> data(A,'Europe',C,D,E,F,G,H,I,J,3.5,L,M,0,O,'English',Q,R,S,T,U,V)| data(A,'Europe',C,D,E,F,G,H,I,J,3.55,L,M,0,O,'English',Q,R,S,T,U,V)| data(A,'Europe',C,D,E,F,G,H,I,J,3.7,L,M,0,O,'English',Q,R,S,T,U,V)| data(A,'North America',C,D,E,F,G,H,I,J,3.5,L,M,0,O,'English',Q,R,S,T,U,V)| data(A,'North America',C,D,E,F,G,H,I,J,3.55,L,M,0,O,'English',Q,R,S,T,U,V)| data(A,'North America',C,D,E,F,G,H,I,J,3.7,L,M,0,O,'English',Q,R,S,T,U,V)| data(A,'Asia',C,D,E,F,G,H,I,J,3.5,L,M,0,O,'English',Q,R,S,T,U,V)| data(A,'Asia',C,D,E,F,G,H,I,J,3.55,L,M,0,O,'English',Q,R,S,T,U,V)| data(A,'Asia',C,D,E,F,G,H,I,J,3.7,L,M,0,O,'English',Q,R,S,T,U,V) ). process4(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q4, Answer ), ( Answer = no -> process5(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V); Answer = yes -> data(A,'North America',C,D,E,F,G,H,I,J,3.5,L,M,1,O,'English',Q,R,S,T,U,7000)| data(A,'North America',C,D,E,F,G,H,I,J,3.55,L,M,1,O,'English',Q,R,S,T,U,7000)| data(A,'North America',C,D,E,F,G,H,I,J,3.7,L,M,1,O,'English',Q,R,S,T,U,7000)| data(A,'North America',C,D,E,F,G,H,I,J,3.5,L,M,1,O,'English',Q,R,S,T,U,6000)| data(A,'North America',C,D,E,F,G,H,I,J,3.55,L,M,1,O,'English',Q,R,S,T,U,6000)| data(A,'North America',C,D,E,F,G,H,I,J,3.7,L,M,1,O,'English',Q,R,S,T,U,6000) ). process5(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q5, Answer ), ( Answer = yes -> data(A,'Europe',C,D,E,F,G,H,I,J,3.5,L,M,1,O,'English',Q,R,S,T,U,4000)| data(A,'Europe',C,D,E,F,G,H,I,J,3.55,L,M,1,O,'English',Q,R,S,T,U,4000)| data(A,'Europe',C,D,E,F,G,H,I,J,3.7,L,M,1,O,'English',Q,R,S,T,U,4000); Answer = no -> data(A,'Asia',C,D,E,F,G,H,I,J,3.5,L,M,1,O,'English',Q,R,S,T,U,2000)| data(A,'Asia',C,D,E,F,G,H,I,J,3.55,L,M,1,O,'English',Q,R,S,T,U,2000)| data(A,'Asia',C,D,E,F,G,H,I,J,3.7,L,M,1,O,'English',Q,R,S,T,U,2000) ). process6(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q6, Answer ), ( Answer = yes -> process7(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V); Answer = no -> data(A,'Asia',C,D,E,F,G,H,I,J,2,L,M,N,O,'English',Q,R,S,T,U,V)| data(A,'Asia',C,D,E,F,G,H,I,J,1,L,M,N,O,'English',Q,R,S,T,U,V)| data(A,B,C,D,E,F,G,H,I,J,0,L,M,N,O,'English',Q,R,S,T,U,V) ). process7(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q3, Answer ), ( Answer = no -> process8(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V); Answer = yes -> data(A,'Asia',C,D,E,F,G,H,I,J,3.3,L,M,1,O,'English',Q,R,S,T,U,V)| data(A,'Asia',C,D,E,F,G,H,I,J,3,L,M,1,O,'English',Q,R,S,T,U,V)| data(A,'Europe',C,D,E,F,G,H,I,J,3.3,L,M,1,O,'English',Q,R,S,T,U,V)| data(A,'Europe',C,D,E,F,G,H,I,J,3,L,M,1,O,'English',Q,R,S,T,U,V) ). process8(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q4, Answer ), ( Answer = no -> process9(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V); Answer = yes -> data(A,'North America',C,D,E,F,G,H,I,J,3.3,L,M,0,O,'English',Q,R,S,T,U,7000)| data(A,'North America',C,D,E,F,G,H,I,J,3,L,M,0,O,'English',Q,R,S,T,U,7000)| data(A,'North America',C,D,E,F,G,H,I,J,3.3,L,M,0,O,'English',Q,R,S,T,U,6000)| data(A,'North America',C,D,E,F,G,H,I,J,3,L,M,0,O,'English',Q,R,S,T,U,6000) ). process9(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q5, Answer ), ( Answer = no -> process10(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V); Answer = yes -> data(A,'Asia',C,D,E,F,G,H,I,J,3.3,L,M,0,O,'English',Q,R,S,T,U,4000)| data(A,'Asia',C,D,E,F,G,H,I,J,3,L,M,0,O,'English',Q,R,S,T,U,4000) ). process10(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q7, Answer ), ( Answer = no -> data(A,'Asia',C,D,E,F,G,H,I,J,3.5,L,6,1,O,'English',Q,R,S,T,U,2000)| data(A,'Asia',C,D,E,F,G,H,I,J,3.55,L,6,1,O,'English',Q,R,S,T,U,2000)| data(A,'Asia',C,D,E,F,G,H,I,J,3.7,L,6,1,O,'English',Q,R,S,T,U,2000)| data(A,'Asia',C,D,E,F,G,H,I,J,3.5,L,5.5,1,O,'English',Q,R,S,T,U,2000)| data(A,'Asia',C,D,E,F,G,H,I,J,3.55,L,5.5,1,O,'English',Q,R,S,T,U,2000)| data(A,'Asia',C,D,E,F,G,H,I,J,3.7,L,5.5,1,O,'English',Q,R,S,T,U,2000); Answer = yes -> data(A,'Europe',C,D,E,F,G,H,I,J,3.3,L,6.5,0,O,'English',Q,R,S,T,U,2000)| data(A,'Europe',C,D,E,F,G,H,I,J,3,L,6.5,0,O,'English',Q,R,S,T,U,2000)| data(A,'Europe',C,D,E,F,G,H,I,J,3.3,L,7,0,O,'English',Q,R,S,T,U,2000)| data(A,'Europe',C,D,E,F,G,H,I,J,3,L,7,0,O,'English',Q,R,S,T,U,2000)| data(A,'Europe',C,D,E,F,G,H,I,J,3.3,L,7.5,0,O,'English',Q,R,S,T,U,2000)| data(A,'Europe',C,D,E,F,G,H,I,J,3,L,7.5,0,O,'English',Q,R,S,T,U,2000) ). process11(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- ask( q8, Answer ), ( Answer = no -> data(A,'Asia',C,D,E,F,G,H,I,J,K,L,M,N,O,'English',Q,R,'US$ 5K - 10k',T,U,V)| data(A,'Asia',C,D,E,F,G,H,I,J,K,L,M,N,O,'English',Q,R,'US$ 10K - 15K',T,U,V); Answer = yes -> data(A,'Europe',C,D,E,F,G,H,I,J,K,L,M,N,O,'English',Q,R,'US$ 25k+',T,U,V) ). ask( Q, A ) :- question( Q, Text ), message_box( yesno, Text, A ).
alirezasamar/UniBase
RULES UPDATED.pl
Perl
mit
6,610
import run from "ember-metal/run_loop"; import {forEach} from "ember-metal/array"; import Application from "ember-application/system/application"; var application, locator; module("Ember.Application Depedency Injection – normalization", { setup: function() { application = run(Application, 'create'); locator = application.__container__; }, teardown: function() { run(application, 'destroy'); } }); test('normalization', function() { ok(locator.normalize, 'locator#normalize is present'); equal(locator.normalize('foo:bar'), 'foo:bar'); equal(locator.normalize('controller:posts'), 'controller:posts'); equal(locator.normalize('controller:posts_index'), 'controller:postsIndex'); equal(locator.normalize('controller:posts.index'), 'controller:postsIndex'); equal(locator.normalize('controller:posts.post.index'), 'controller:postsPostIndex'); equal(locator.normalize('controller:posts_post.index'), 'controller:postsPostIndex'); equal(locator.normalize('controller:posts.post_index'), 'controller:postsPostIndex'); equal(locator.normalize('controller:postsIndex'), 'controller:postsIndex'); equal(locator.normalize('controller:blogPosts.index'), 'controller:blogPostsIndex'); equal(locator.normalize('controller:blog/posts.index'), 'controller:blog/postsIndex'); equal(locator.normalize('controller:blog/posts.post.index'), 'controller:blog/postsPostIndex'); equal(locator.normalize('controller:blog/posts_post.index'), 'controller:blog/postsPostIndex'); equal(locator.normalize('template:blog/posts_index'), 'template:blog/posts_index'); }); test('normalization is indempotent', function() { var examples = ['controller:posts', 'controller:posts.post.index', 'controller:blog/posts.post_index', 'template:foo_bar']; forEach.call(examples, function (example) { equal(locator.normalize(locator.normalize(example)), locator.normalize(example)); }); });
1337807/ember.js
packages_es6/ember-application/tests/system/dependency_injection/normalization_test.js
JavaScript
mit
1,920
package main import ( "bytes" "fmt" "go/build" "reflect" "sort" "strings" "testing" ) func TestCallgraph(t *testing.T) { ctxt := build.Default // copy ctxt.GOPATH = "testdata" const format = "{{.Caller}} --> {{.Callee}}" for _, test := range []struct { algo, format string tests bool want []string }{ {"rta", format, false, []string{ // rta imprecisely shows cross product of {main,main2} x {C,D} `pkg.main --> (pkg.C).f`, `pkg.main --> (pkg.D).f`, `pkg.main --> pkg.main2`, `pkg.main2 --> (pkg.C).f`, `pkg.main2 --> (pkg.D).f`, }}, {"pta", format, false, []string{ // pta distinguishes main->C, main2->D. Also has a root node. `<root> --> pkg.init`, `<root> --> pkg.main`, `pkg.main --> (pkg.C).f`, `pkg.main --> pkg.main2`, `pkg.main2 --> (pkg.D).f`, }}, // tests: main is not called. {"rta", format, true, []string{ `pkg.Example --> (pkg.C).f`, `testmain.init --> pkg.init`, }}, {"pta", format, true, []string{ `<root> --> pkg.Example`, `<root> --> testmain.init`, `pkg.Example --> (pkg.C).f`, `testmain.init --> pkg.init`, }}, } { stdout = new(bytes.Buffer) if err := doCallgraph(&ctxt, test.algo, test.format, test.tests, []string{"pkg"}); err != nil { t.Error(err) continue } got := sortedLines(fmt.Sprint(stdout)) if !reflect.DeepEqual(got, test.want) { t.Errorf("callgraph(%q, %q, %t):\ngot:\n%s\nwant:\n%s", test.algo, test.format, test.tests, strings.Join(got, "\n"), strings.Join(test.want, "\n")) } } } func sortedLines(s string) []string { s = strings.TrimSpace(s) lines := strings.Split(s, "\n") sort.Strings(lines) return lines }
red2901/gows
src/code.google.com/p/go.tools/cmd/callgraph/main_test.go
GO
mit
1,696
HTTP =========== HTTP Header wrapper. ## Purpose The objective of this library is to provide a test-ready alternative to PHP's default `header()` interface. Instead of sending headers directly, you can add them to PHP using this library. Additionally, you can easily mock this library in your own projects to fully decouple code from PHP primitives. ## Installation This module can be easily installed by adding `10up/http` to your `composer.json` file. Then, either autoload your Composer dependencies or manually `include()` the `HTTP.php` bootstrap file. ## Use Rather than invoking PHP's `header()` method directly, simply call `\TenUp\HTTP\v1_0_0\add()` to add new headers. This allows you to specify a key, a value, and flag whether or not to overwrite existing values. All headers loaded into the system will be sent to the browser when WordPress invokes it's usual `send_headers` action; there is no other work you need to do on your own. ## Changelog ### 1.0 - First public release
johnpbloch/HTTP
README.md
Markdown
mit
1,001
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="format-detection" content="telephone=no"> <title>全部菜单(发现)</title> <meta name="description" content=""> <meta name="keywords" content=""> <link href="__CSS__/communal.css" rel="stylesheet"> <script src="__JS__/communal.js"></script> <link href="__CSS__/style.css" rel="stylesheet"> <script> var request = { QueryString : function(val) { var uri = window.location.search; var re = new RegExp("" +val+ "=([^&?]*)", "ig"); return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null); } } var rurl=request.QueryString("str"); </script> </head> <body> <header> <div class="login-header"> <i class="iconfont"> <a href="#" onclick="javascript:location.href=rurl+'.html';">&#xe604;</a> </i> <div class="login-choose">全部菜单</div> </div> </header> <article class="all-menu-matter"> <div class="all-menu-block"> <!-- 股票质押 --> <div class="all-menu-stock clearfix"> <div class="all-menu-stocks fl"> <a href="found-stock.html"> <i class="iconfont">&#xe661;</i> <div>股票质押</div> </a> </div> <div class="all-menu-stocks fl"> <a href="underweight.html"> <i class="iconfont">&#xe7e7;</i> <div>大宗减持</div> </a> </div> <div class="all-menu-stocks fl"> <a href="found-pledge.html"> <i class="iconfont">&#xe669;</i> <div>企业理财</div> </a> </div> </div> <!-- 分红避税 --> <div class="all-menu-bonus clearfix"> <div class="all-menu-bonuks fl"> <a href="dividend.html"> <i class="iconfont">&#xe653;</i> <div>分红避税</div> </a> </div> <div class="all-menu-bonuks fl"> <a href="found-credit.html"> <i class="iconfont">&#xe62b;</i> <div>信用贷款</div> </a> </div> <div class="all-menu-bonuks fl"> <a href="found-appre.html"> <i class="iconfont">&#xe626;</i> <div>股票增值</div> </a> </div> </div> <!-- 可交换债 --> <div class="all-menu-exchange clearfix"> <div class="all-menu-exchanges fl"> <a href="bonds.html?str=all-menu"> <i class="iconfont">&#xe715;</i> <div>可交换债</div> </a> </div> <div class="all-menu-exchanges fl"> <a href="bridge.html?str=all-menu"> <i class="iconfont">&#xe65f;</i> <div>过桥短融</div> </a> </div> <div class="all-menu-exchanges fl"> <a href="trading.html?str=all-menu"> <i class="iconfont">&#xe654;</i> <div>定增配资</div> </a> </div> </div> <!-- 定增拼单 --> <div class="all-menu-change clearfix"> <div class="all-menu-changes fl"> <a href="channel?str=all-menu"> <i class="iconfont">&#xe6bf;</i> <div>定增拼单</div> </a> </div> <div class="all-menu-changes fl"> <a href="channel.html?str=all-menu"> <i class="iconfont">&#xe692;</i> <div>定增通道</div> </a> </div> <div class="all-menu-changes fl"> <a href="channel.html?str=all-menu"> <i class="iconfont">&#xe689;</i> <div>定增发布</div> </a> </div> </div> <!-- 定增参与 --> <div class="all-menu-custom clearfix"> <div class="all-menu-customs fl"> <a href="channel.html?str=all-menu"> <i class="iconfont">&#xe6a7;</i> <div>定增参与</div> </a> </div> <div class="all-menu-customs fl"> <a href="channel.html"> <i class="iconfont">&#xe65c;</i> <div>并购转让</div> </a> </div> <div class="all-menu-customs fl"> <a href="market.html?str=all-menu"> <i class="iconfont">&#xe696;</i> <div>市值管理方案定制</div> </a> </div> </div> </div> </article> </body> </html>
jinrong-team/jinrong
Application/User1/View/index/Find/all-menu.html
HTML
mit
5,679
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="es"> <head> <!-- Generated by javadoc (version 1.7.0_03) on Tue Jun 19 11:12:54 COT 2012 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>J-Index</title> <meta name="date" content="2012-06-19"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="J-Index"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li class="navBarCell1Rev">Index</li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-8.html">Prev Letter</a></li> <li><a href="index-10.html">Next Letter</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-filesindex-9.html" target="_top">Frames</a></li> <li><a href="index-9.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="contentContainer"><a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">I</a>&nbsp;<a href="index-9.html">J</a>&nbsp;<a href="index-10.html">K</a>&nbsp;<a href="index-11.html">L</a>&nbsp;<a href="index-12.html">M</a>&nbsp;<a href="index-13.html">N</a>&nbsp;<a href="index-14.html">P</a>&nbsp;<a href="index-15.html">R</a>&nbsp;<a href="index-16.html">S</a>&nbsp;<a href="index-17.html">T</a>&nbsp;<a href="index-18.html">U</a>&nbsp;<a href="index-19.html">V</a>&nbsp;<a href="index-20.html">W</a>&nbsp;<a href="index-21.html">X</a>&nbsp;<a name="_J_"> <!-- --> </a> <h2 class="title">J</h2> <dl> <dt><span class="strong"><a href="../BESA/Kernel/Agent/AgentBESA.html#joinBehaviors(double)">joinBehaviors(double)</a></span> - Method in class BESA.Kernel.Agent.<a href="../BESA/Kernel/Agent/AgentBESA.html" title="class in BESA.Kernel.Agent">AgentBESA</a></dt> <dd> <div class="block">Synchronizes the death of threads of the behaviors associates.</div> </dd> </dl> <a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">I</a>&nbsp;<a href="index-9.html">J</a>&nbsp;<a href="index-10.html">K</a>&nbsp;<a href="index-11.html">L</a>&nbsp;<a href="index-12.html">M</a>&nbsp;<a href="index-13.html">N</a>&nbsp;<a href="index-14.html">P</a>&nbsp;<a href="index-15.html">R</a>&nbsp;<a href="index-16.html">S</a>&nbsp;<a href="index-17.html">T</a>&nbsp;<a href="index-18.html">U</a>&nbsp;<a href="index-19.html">V</a>&nbsp;<a href="index-20.html">W</a>&nbsp;<a href="index-21.html">X</a>&nbsp;</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li class="navBarCell1Rev">Index</li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-8.html">Prev Letter</a></li> <li><a href="index-10.html">Next Letter</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-filesindex-9.html" target="_top">Frames</a></li> <li><a href="index-9.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 ======= --> </body> </html>
Coregraph/Ayllu
JigSaw - AYPUY - CS/BESA3/BESA-DOC/jdoc/KernelBESA/index-files/index-9.html
HTML
mit
5,448