private static void AddQuoted(ILuaState lua, StringBuilder sb, int arg) { var s = lua.L_CheckString(arg); sb.Append('"'); for (var i = 0; i < s.Length; ++i) { var c = s[i]; if (c == '"' || c == '\\' || c == '\n') { sb.Append('\\').Append(c); } else if (c == '\0' || Char.IsControl(c)) { if (i + 1 >= s.Length || !Char.IsDigit(s[i + 1])) { sb.AppendFormat("\\{0:D}", (int)c); } else { sb.AppendFormat("\\{0:D3}", (int)c); } } else { sb.Append(c); } } sb.Append('"'); }
/// <summary> /// Finds the Global Address List associated with the MailStore /// </summary> /// <param name="folderPath">parameter for FindFolder</param> /// <returns>IMailFolder for the target of the event</returns> /// In this case the Folder element is a path in Outlook. Each component of the path separated by '\'. /// The first or default folder in the path, can be preceded by "\\" or nothing. If it's the only part of /// the path, then it MUST be one of the default OL folders (see the schema for the EventMonitor operation). public IMailFolder FindFolder(string folderPath) { IMailFolder folder; System.Char backslash = '\\'; if (folderPath.StartsWith(@"\\")) { folderPath = folderPath.Remove(0, 2); } String[] folders = folderPath.Split(backslash); folder = GetDefaultFolder(folders[0]); if (folder != null) { for (int i = 1; i <= folders.Length - 1; i++) { IEnumerable <IMailFolder> subFolders = folder.SubFolders; folder = subFolders.FirstOrDefault(fld => fld.Name.Equals(folders[i], StringComparison.CurrentCultureIgnoreCase)); if (folder == null) { return(null); } } } return(folder); }
void DoProcess() { if (!(c1.Value is OpenCVForUnityPlayMakerActions.Char)) { LogError("c1 is not initialized. Add Action \"newChar\"."); return; } System.Char wrapped_c1 = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Char, System.Char>(c1); if (!(c2.Value is OpenCVForUnityPlayMakerActions.Char)) { LogError("c2 is not initialized. Add Action \"newChar\"."); return; } System.Char wrapped_c2 = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Char, System.Char>(c2); if (!(c3.Value is OpenCVForUnityPlayMakerActions.Char)) { LogError("c3 is not initialized. Add Action \"newChar\"."); return; } System.Char wrapped_c3 = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Char, System.Char>(c3); if (!(c4.Value is OpenCVForUnityPlayMakerActions.Char)) { LogError("c4 is not initialized. Add Action \"newChar\"."); return; } System.Char wrapped_c4 = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Char, System.Char>(c4); storeResult.Value = OpenCVForUnity.VideoioModule.VideoWriter.fourcc(wrapped_c1, wrapped_c2, wrapped_c3, wrapped_c4); }
public static bool _WriteLine_System_IO_StringWriter_System_Char( ) { //Parameters System.Char _value = null; //Exception Exception exception_Real = null; Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnValue_Real = System.IO.StringWriter.WriteLine(_value); } catch (Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnValue_Intercepted = System.IO.StringWriter.WriteLine(_value); } catch (Exception e) { exception_Intercepted = e; } }
public static bool _Write_System_IO_BinaryWriter_System_Char( ) { //Parameters System.Char ch = null; //Exception Exception exception_Real = null; Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnValue_Real = System.IO.BinaryWriter.Write(ch); } catch (Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnValue_Intercepted = System.IO.BinaryWriter.Write(ch); } catch (Exception e) { exception_Intercepted = e; } }
public Nfa BuildBasic(Input input) { var nfa = new Nfa(2); nfa.AddTransition(nfa.Initial, nfa.Final, input); return(nfa); }
/// <summary> /// /// </summary> /// <param name="position"></param> /// <param name="character"></param> public void SetChar(System.Int32 position, System.Char character) { #region Check position is invalid if ((position >= this.size) || (position < 0)) { throw new System.ArgumentOutOfRangeException(); } #endregion #region Check memory is protected if (this.isProtected) { throw new StringProtectedException(); } #endregion #region Set char this.data[position] = ((System.Byte)character); #endregion }
private static bool MatchClass(char c, char cl) { bool res; switch (cl) { case 'a': res = Char.IsLetter(c); break; case 'c': res = Char.IsControl(c); break; case 'd': res = Char.IsDigit(c); break; case 'g': throw new System.NotImplementedException(); case 'l': res = Char.IsLower(c); break; case 'p': res = Char.IsPunctuation(c); break; case 's': res = Char.IsWhiteSpace(c); break; case 'u': res = Char.IsUpper(c); break; case 'w': res = Char.IsLetterOrDigit(c); break; case 'x': res = IsXDigit(c); break; case 'z': res = (c == '\0'); break; /* deprecated option */ default: return(cl == c); } return(res); }
void DoProcess() { string[] string_images = images.stringValues; List <string> wrapped_images = new List <string>(string_images); if (!(facePoints.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("facePoints is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_facePoints = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(facePoints); if (!(delim.Value is OpenCVForUnityPlayMakerActions.Char)) { LogError("delim is not initialized. Add Action \"newChar\"."); return; } System.Char wrapped_delim = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Char, System.Char>(delim); storeResult.Value = OpenCVForUnity.FaceModule.Face.loadTrainingData(filename.Value, wrapped_images, wrapped_facePoints, wrapped_delim, offset.Value); for (int i = 0; i < wrapped_images.Count; i++) { images.Set(i, (string)wrapped_images[i]); } images.SaveChanges(); Fsm.Event(storeResult.Value ? trueEvent : falseEvent); }
private static void Add_S(MatchState ms, StringBuilder b, int s, int e) { string news = ms.Lua.ToString(3); for (int i = 0; i < news.Length; i++) { if (news[i] != L_ESC) { b.Append(news[i]); } else { i++; /* skip ESC */ if (!Char.IsDigit((news[i]))) { b.Append(news[i]); } else if (news[i] == '0') { b.Append(ms.Src.Substring(s, (e - s))); } else { PushOneCapture(ms, news[i] - '1', s, e); b.Append(ms.Lua.ToString(-1)); /* add capture to accumulated result */ } } } }
virtual protected void action(System.Int32 i) { if (i < 2) { this.output.Append(this.a); } if (i < 3) { this.a = this.b; if (this.a == '\'' || this.a == '"') { while (true) { this.output.Append(this.a); if (!this.nextCharNoSlash(this.b, "Unterminated string literal.")) { break; } } } } if (i < 4) { this.b = this.next(); if (this.b == '/') { switch (this.a) { case MyMin.LF: case MyMin.SPACE: case '{': case ';': case '(': case ',': case '=': case ':': case '[': case '!': case '&': case '|': case '?': if ((MyMin.LF == this.a || MyMin.SPACE == this.a) && !this.spaceBeforeRegExp(this.output.ToString())) { break; } this.output.Append(this.a); this.output.Append(this.b); while (this.nextCharNoSlash('/', "Unterminated regular expression literal.")) { this.output.Append(this.a); } this.b = this.next(); break; } } } }
public void NvtExecuteChar(System.Char CurChar) { switch (CurChar) { default: System.Console.WriteLine("Telnet command {0} encountered", CurChar); break; } }
virtual protected void appendComment(System.Int32 pos, System.String open, System.String close) { this.output.Append(this.a); this.output.Append(open); this.output.Append(new MyMin(this.input.Substring(this.index, pos - this.index), this.cc_on)); this.output.Append(close); this.index = pos; this.a = MyMin.LF; }
virtual protected void conditionalComment(System.Char find) { System.Int32 pos = this.input.IndexOf(find, this.index); if (pos < 0) { pos = this.length; } this.appendComment(pos, "//", find.ToString()); }
virtual protected System.Char get() { System.Char c = this.ahead; this.ahead = MyMin.EOS; if (c == MyMin.EOS && this.index < this.length) { c = this.input[this.index++]; } return((c == MyMin.EOS || c == MyMin.LF || c >= MyMin.SPACE) ? c : MyMin.SPACE); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Char)) { owner.Value = new OpenCVForUnityPlayMakerActions.Char(new System.Char()); } System.Char wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Char, System.Char>(owner); storeResult.Value = (string)wrapped_owner.ToString(); }
/// <summary> /// Match is a static method that determines whether /// or not the token starting at /// <paramref name="begin">begin</paramref> /// is an C# identifier. /// </summary> /// <param name="begin">begin</param> /// <param name="end">end</param> internal static bool Match(Position begin, Position end) { if (begin == end) { return(false); } char read = begin.Get(); return(Ctype.IsLetter(read) || read == '_'); }
public ParserEventArgs( Actions p1, System.Char p2, System.String p3, uc_Params p4) { //prntSome.printSome("ParserEventArgs"); Action = p1; CurChar = p2; CurSequence = p3; CurParams = p4; }
public NvtParserEventArgs( NvtActions p1, System.Char p2, System.String p3, uc_Params p4) { //prntSome.printSome("NvtParserEventArgs"); Action = p1; CurChar = p2; CurSequence = p3; CurParams = p4; }
// Every character received is treated as an event which could change the state of // the parser. The following section finds out which event or state change this character // should trigger and also finds out where we should store the incoming character. // The character may be a command, part of a sequence or a parameter; or it might just need // binning. // The sequence is: state change, store character, do action. public void ParseString(System.String InString) { //prntSome.printSome("ParseString"); States NextState = States.None; Actions NextAction = Actions.None; Actions StateExitAction = Actions.None; Actions StateEntryAction = Actions.None; foreach (System.Char C in InString) { this.CurChar = C; // Get the next state and associated action based // on the current state and char event CharEvents.GetStateEventAction(State, CurChar, ref NextState, ref NextAction); // execute any actions arising from leaving the current state if (NextState != States.None && NextState != this.State) { // check for state exit actions StateChangeEvents.GetStateChangeAction(this.State, Transitions.Exit, ref StateExitAction); // Process the exit action if (StateExitAction != Actions.None) { DoAction(StateExitAction); } } // process the action specified if (NextAction != Actions.None) { DoAction(NextAction); } // set the new parser state and execute any actions arising entering the new state if (NextState != States.None && NextState != this.State) { // change the parsers state attribute this.State = NextState; // check for state entry actions StateChangeEvents.GetStateChangeAction(this.State, Transitions.Entry, ref StateExitAction); // Process the entry action if (StateEntryAction != Actions.None) { DoAction(StateEntryAction); } } } }
//1023 public static System.String ConvertUint32ToString(System.UInt32 number) { System.UInt32 rank = GetRankOf(number); System.UInt32 numberLength = rank + 1; System.Char[] result = new System.Char[numberLength]; for (System.UInt32 i = 0; i < numberLength; i++) { result[i] = (System.Char)(GetNumberOfDigit(number, rank)) + '0'; rank--; } System.Console.WriteLine($"rank={rank}"); return(result.ToString()); }
virtual protected System.Char next() { System.Char c = this.get(); System.Boolean loop = true; if (c == '/') { switch (this.ahead = this.get()) { case '/': if (this.cc_on && this.input[this.index] == '@') { this.conditionalComment(MyMin.LF); } while (loop) { c = this.get(); if (c <= MyMin.LF) { loop = false; } } break; case '*': this.get(); if (this.cc_on && this.input[this.index] == '@') { this.conditionalComment("*/"); } while (loop) { switch (this.get()) { case '*': if ((this.ahead = this.get()) == '/') { this.get(); c = MyMin.SPACE; loop = false; } break; case MyMin.EOS: throw new MyMinException("Unterminated comment."); } } break; } } return(c); }
public States NextState; // the next state we are going to public uc_CharEventInfo( States p1, System.Char p2, System.Char p3, Actions p4, States p5) { //prntSome.printSome("uc_CharEventInfo"); this.CurState = p1; this.CharFrom = p2; this.CharTo = p3; this.NextAction = p4; this.NextState = p5; }
public JsonResult Get(string name) { List <City> citylist = new List <City>(); SCountry sco = new SCountry(); System.Char delimiter = '-'; var ciudad = sco.FindCityByName(name.Split(delimiter)[1]); citylist = sco.FindCitiesByCountry(int.Parse(name.Split(delimiter)[0])).Where(e => e.Id != ciudad.Id).ToList(); citylist.Insert(0, ciudad); return(new JsonResult { Data = citylist, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
/// <summary> /// バイナリよりSZipヘッダ情報を読み取ります /// read szip header infomation from binary /// </summary> public void Read(System.IO.BinaryReader reader) { _magic = new System.Char[4]; _magic[0] = reader.ReadChar(); _magic[1] = reader.ReadChar(); _magic[2] = reader.ReadChar(); _magic[3] = reader.ReadChar(); _version = reader.ReadUInt16(); _contentCount = reader.ReadInt16(); _contentNameTableCrc = reader.ReadUInt32(); _contentHeaderTableCrc = reader.ReadUInt32(); _compressedContentHeaderTableSize = reader.ReadInt32(); _originalContentNameTableSize = reader.ReadInt32(); _compressedContentNameTableSize = reader.ReadInt32(); }
virtual protected System.Boolean action(System.Char c) { System.Boolean r = true; switch (c) { case '}': case '{': case ';': case ',': case ':': r = false; break; } return(r); }
public void Add(System.Char CurChar) { //prntSome.printSome("Add"); if (this.Count() < 1) { this.Elements.Add("0"); } if (CurChar == ';') { this.Elements.Add("0"); } else { int i = this.Elements.Count - 1; this.Elements[i] = this.Elements[i] + CurChar.ToString(); } }
private void PrintChar(System.Char CurChar) { //prntSome.printSome("PrintChar"); if (this.Caret.EOL == true) { if ((this.Modes.Flags & uc_Mode.AutoWrap) == uc_Mode.AutoWrap) { this.LineFeed(); this.CarriageReturn(); this.Caret.EOL = false; } } System.Int32 X = this.Caret.Pos.X; System.Int32 Y = this.Caret.Pos.Y; this.AttribGrid[Y][X] = this.CharAttribs; if (this.CharAttribs.GS != null) { CurChar = uc_Chars.Get(CurChar, this.AttribGrid[Y][X].GS.Set, this.AttribGrid[Y][X].GR.Set); if (this.CharAttribs.GS.Set == uc_Chars.Sets.DECSG) { this.AttribGrid[Y][X].IsDECSG = true; } this.CharAttribs.GS = null; } else { CurChar = uc_Chars.Get(CurChar, this.AttribGrid[Y][X].GL.Set, this.AttribGrid[Y][X].GR.Set); if (this.CharAttribs.GL.Set == uc_Chars.Sets.DECSG) { this.AttribGrid[Y][X].IsDECSG = true; } } this.CharGrid[Y][X] = CurChar; this.CaretRight(); }
public static bool _HexUnescape_System_String_System_Int32_( ) { //Parameters System.String pattern = null; System.Int32& index = null; //ReturnType/Value System.Char returnVal_Real = null; System.Char returnVal_Intercepted = null; //Exception Exception exception_Real = null; Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnValue_Real = System.Uri.HexUnescape(pattern, index); } catch (Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnValue_Intercepted = System.Uri.HexUnescape(pattern, index); } catch (Exception e) { exception_Intercepted = e; } Return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
/// <summary> /// SZipヘッダ情報を設定します。 /// set szip header information /// </summary> public void Set(System.Int16 contentCount, //要素数 System.UInt32 contentNameTableCrc, //要素名テーブル圧縮後Hash値 System.UInt32 contentHeaderTableCrc, //要素情報テーブル圧縮後Hash値 System.Int32 compressedContentHeaderTableSize, //要素情報テーブル圧縮後サイズ System.Int32 originalContentNameTableSize, //要素名テーブル圧縮前サイズ System.Int32 compressedContentNameTableSize //要素情報テーブル圧縮後サイズ ) { _magic = new System.Char[4] { 'S', 'Z', 'I', 'P' }; _version = SZipConstant.VERSION; _contentCount = contentCount; _contentNameTableCrc = contentNameTableCrc; _contentHeaderTableCrc = contentHeaderTableCrc; _compressedContentHeaderTableSize = compressedContentHeaderTableSize; _originalContentNameTableSize = originalContentNameTableSize; _compressedContentNameTableSize = compressedContentNameTableSize; }
public static bool _ToChar_System_String( ) { //Parameters System.String s = null; //ReturnType/Value System.Char returnVal_Real = null; System.Char returnVal_Intercepted = null; //Exception Exception exception_Real = null; Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnValue_Real = System.Xml.XmlConvert.ToChar(s); } catch (Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnValue_Intercepted = System.Xml.XmlConvert.ToChar(s); } catch (Exception e) { exception_Intercepted = e; } Return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
virtual protected void init(System.String input, System.Boolean cc_on) { this.input = System.Text.RegularExpressions.Regex.Replace(input.Trim(), "(\n\r|\r\n|\r|\n)+", MyMin.LF.ToString()); this.input = System.Text.RegularExpressions.Regex.Replace(this.input.Trim(), "(\\\\\n)+", "");//有问题,修改之 this.length = this.input.Length; this.cc_on = cc_on; this.a = MyMin.LF; this.action(3); while (this.a != MyMin.EOS) { switch (this.a) { case MyMin.SPACE: this.action(this.isAlNum(this.b) ? 1 : 2); break; case MyMin.LF: switch (this.b) { case '{': case '[': case '(': case '+': case '-': this.action(1); break; case MyMin.SPACE: this.action(3); break; default: this.action(this.isAlNum(this.b) ? 1 : 2); break; } break; default: switch (this.b) { case MyMin.SPACE: this.action(this.isAlNum(this.a) ? 1 : 3); break; case MyMin.LF: switch (this.a) { case '}': case ']': case ')': case '+': case '-': case '"': case '\'': this.action(1); break; default: this.action(this.isAlNum(this.a) ? 1 : 3); break; } break; default: this.action(1); break; } break; } } }
public TimedChar() { _Tm = default(System.DateTime); _Data = new System.Char(); }
public TimedChar(global::RTC.TimedChar source) { _Tm = Converter.RtcTimeToDateTime(source.tm); _Data = source.data; }
public void ParseString(System.String InString) { //prntSome.printSome("ParseString"); States NextState = States.None; NvtActions NextAction = NvtActions.None; NvtActions StateExitAction = NvtActions.None; NvtActions StateEntryAction = NvtActions.None; foreach (System.Char C in InString) { this.CurChar = C; // Get the next state and associated action based // on the current state and char event CharEvents.GetStateEventAction (State, CurChar, ref NextState, ref NextAction); // execute any actions arising from leaving the current state if (NextState != States.None && NextState != this.State) { // check for state exit actions StateChangeEvents.GetStateChangeAction (this.State, Transitions.Exit, ref StateExitAction); // Process the exit action if (StateExitAction != NvtActions.None) DoAction (StateExitAction); } // process the action specified if (NextAction != NvtActions.None) DoAction (NextAction); // set the new parser state and execute any actions arising entering the new state if (NextState != States.None && NextState != this.State) { // change the parsers state attribute this.State = NextState; // check for state entry actions StateChangeEvents.GetStateChangeAction (this.State, Transitions.Entry, ref StateExitAction); // Process the entry action if (StateEntryAction != NvtActions.None) DoAction (StateEntryAction); } } }
public States NextState; // the next state we are going to public uc_CharEventInfo( States p1, System.Char p2, System.Char p3, NvtActions p4, States p5) { //prntSome.printSome("uc_CharEventInfo"); this.CurState = p1; this.CharFrom = p2; this.CharTo = p3; this.NextAction = p4; this.NextState = p5; }
virtual protected System.Boolean nextCharNoSlash(System.Char c, System.String message) { System.Boolean loop = true; this.a = this.get(); if (this.a == c) loop = false; else { if (this.a == '\\') { this.output.Append(this.a); this.a = this.get(); } if (this.a <= MyMin.LF) throw new MyMinException(message); } return loop; }
virtual protected void action(System.Int32 i) { if (i < 2) this.output.Append(this.a); if (i < 3) { this.a = this.b; if (this.a == '\'' || this.a == '"') { while (true) { this.output.Append(this.a); if (!this.nextCharNoSlash(this.b, "Unterminated string literal.")) break; } } } if (i < 4) { //修复之 char old_b = this.b; this.b = this.next(); if (old_b == ' ' && this.b == '+' && this.input[index] == '+') { this.output.Append(this.a); this.output.Append(old_b); this.a = old_b; return; } if (old_b == ' ' && ((this.a == '+' && this.b == '+' && this.input[index] != '+') || (this.a == '-' && this.b == '-' && this.input[index] != '-'))) { this.output.Append(this.a); this.output.Append(old_b); this.a = old_b; return; } if (this.b == '/') { switch (this.a) { case MyMin.LF: case MyMin.SPACE: case '{': case ';': case '(': case ',': case '=': case ':': case '[': case '!': case '&': case '|': case '?': if ((MyMin.LF == this.a || MyMin.SPACE == this.a) && !this.spaceBeforeRegExp(this.output.ToString())) break; this.output.Append(this.a); this.output.Append(this.b); while (this.nextCharNoSlash('/', "Unterminated regular expression literal.")) this.output.Append(this.a); this.b = this.next(); break; } } } }