private void button2_Click(object sender, EventArgs e) { LI lo = new LI(); lo.Show(); this.Hide(); }
/// <summary> /// /// </summary> /// <param name="stream"></param> /// <param name="text"></param> /// <param name="liClass"></param> /// <param name="liID"></param> /// <param name="hrefParams"></param> protected void WriteLiHref(StringWriter stream, string text, string liClass, string liID, params object[] hrefParams) { using (var li = new LI(stream, HtmlAttributes.@class, liClass, HtmlAttributes.id, liID)) { Href(stream, text, hrefParams); } }
public void input_file(string filepath) { this.infile = filepath; this.cache = ""; localFile LI; if (!open(out LI, this.infile)) { perlException("Unable to open " + this.infile); } string line; int debugSafety = 0; while ((line = LI.getLine()) != null && debugSafety < 9999) { this.cache += line; debugSafety++; } if (debugSafety == 9999) { Logger.LogError("WARNING: INFINITE WHILE BROKEN"); } close(LI); }
public WorkShop() { InitializeComponent(); var network = new Network(); var solver = new ODESolver(); var recorder = new Recorder(Simulator, RecordType.None, "Soul"); Simulator = new Simulator(0.01, 50, network, solver, recorder); IsReportProgress = true; CellNet = new CellNet(network); IsImaging = true; var transformGroup = new Transform3DGroup(); TranslateTransform = new TranslateTransform3D(); RotateTransform = new RotateTransform3D(new QuaternionRotation3D()); ScaleTransform = new ScaleTransform3D(); transformGroup.Children.Add(TranslateTransform); transformGroup.Children.Add(RotateTransform); transformGroup.Children.Add(ScaleTransform); ModelVisual.Transform = transformGroup; ActionType = ActionType.None; MouseLeftButtonDown += WorkShop_MouseLeftButtonDown; MouseLeftButtonUp += WorkShop_MouseLeftButtonUp; MouseRightButtonDown += WorkShop_MouseRightButtonDown; MouseRightButtonUp += WorkShop_MouseRightButtonUp; MouseMove += WorkShop_MouseMove; MouseWheel += WorkShop_MouseWheel; var n = new LI(-50, -48, 5, 2, -55); var net0 = Proliferation.Division(n, new Point3D(1, 10, 10), "InitPotential", new Randomizer(new RNG(), dimyend: 9, dimzend: 9, mean: -50.0, std: 5)); net0.ReSet(); //net0.ReShape(new Point3D(2, 10, 5)); var net1 = Proliferation.Division(n, new Point3D(1, 10, 10), "InitPotential", new Randomizer(new RNG(), dimyend: 9, dimzend: 9, mean: -50.0, std: 10)); net1.ReSet(); Projection.From_To(net0, net1, new WeightSynapse(null, 1), ProjectionType.OneToOne, 1.0); Projection.From_To(net0, net0, new WeightSynapse(null, -0.4), ProjectionType.AllToAll, 0.3); Projection.From_To(net1, net0, new WeightSynapse(null, -0.1), ProjectionType.AllToAll, 0.5); Projection.From_To(net1, net1, new WeightSynapse(null, 0.1), ProjectionType.OneToOne, 0.8); var net = new Network(); net.ChildNetworks.Add(net0.ID, net0); net.ChildNetworks.Add(net1.ID, net1); LoadNetwork(net); CellNet.ChildCellNet[net0.ID].Position = new Point3D(-15, 0, 15); }
public ICell Develop(NeuronType neurontype, double threshold = -50, double initpotential = -60, double restpotential = -60, double r = 5, double c = 2, double resetpotential = -60, double refractoryperiod = 1) { INeuron neuron = null; switch (neurontype) { case NeuronType.MP: neuron = new MP(threshold, initpotential); break; case NeuronType.LI: neuron = new LI(threshold, initpotential, r, c, restpotential); break; case NeuronType.IF: neuron = new IF(threshold, resetpotential, refractoryperiod, initpotential, r, c, restpotential); break; } return Develop(neuron); }
IEnumerable <LogEntry> ParseEntries(string CSVFile) { string[] Lines = File.ReadAllLines(CSVFile); DataCount = 0; for (int i = 0; i < Lines.Length; i++) { string[] Values = Lines[i].Split(new[] { ',' }).Select(Utils.StripQuotes).ToArray(); if (i == 0) { for (int j = 0; j < Values.Length; j++) { LogIndex Idx = GetField(Values[j]); if (Idx != null) { Idx.CsvIndex = j; Idx.Index = DataCount++; } } LogIndices = LogIndices.Where(LI => LI.IsValid()).ToArray(); } else { LogEntry Entry = new LogEntry(DataCount); foreach (LogIndex LogIndex in LogIndices) { /*if (!LogIndex.IsValid()) * continue;*/ Entry[LogIndex] = LogIndex.Parse(Values[LogIndex.CsvIndex]); } yield return(Entry); } } }
/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="ctx"></param> /// <param name="stream"></param> /// <param name="authObj"></param> /// <returns></returns> public override Task Render(RequestContext ctx, StringWriter stream, IDummy authObj) { #if !MONO foreach (string name in m_sharedJsFilenames) { AddResource(new JsResource(Constants.kWebRoot, name, true)); } #endif AddResource(new CssResource(Constants.kWebRoot, "/css/site.css", true)); AddResource(new CssResource(Constants.kWebRoot, "/css/bootstrap.min.css", true)); AddResource(new FavIconResource(Constants.kWebRoot, "/images/favicon.ico")); AddResource(new TitleResource("Metaexchange")); AddResource(new MetaResource("viewport", "width=device-width, initial-scale=1")); ImgResource brand = new ImgResource(Constants.kWebRoot, "/images/brandTitle.png", "", false); AddResource(brand); // render head base.Render(ctx, stream, authObj); m_stream.WriteLine("<!-- Just for debugging purposes. Don't actually copy this line! --> <!--[if lt IE 9]><script src=\"../../assets/js/ie8-responsive-file-warning.js\"></script><![endif]--> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src=\"https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js\"></script> <script src=\"https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js\"></script><![endif]-->"); // begin body m_stream.WriteLine("<body>"); using (new DivContainer(m_stream, HtmlAttributes.@class, "navbar navbar-default navbar-fixed-top")) { using (new DivContainer(m_stream, HtmlAttributes.@class, "container")) { using (new DivContainer(m_stream, HtmlAttributes.@class, "navbar-header")) { using (new Link(m_stream, HtmlAttributes.@class, "navbar-brand", HtmlAttributes.href, "/")) { brand.Write(m_stream); m_stream.Write(" metaexchange"); } } using (new DivContainer(m_stream, HtmlAttributes.@class, "navbar-collapse collapse")) { string page = ctx.Request.Url.LocalPath.Split('/').Last(); IEnumerable <MarketRow> allMarkets = authObj.m_database.GetAllMarkets().Where(m => m.visible); using (var ul = new UL(stream, "nav navbar-nav pull-left")) { using (var li = new LI(stream, "dropdown")) { Href(stream, "Markets <span class=\"caret\">", HtmlAttributes.href, "/", HtmlAttributes.@class, "disabled", "data-toggle", "dropdown", "role", "button", "aria-expanded", "false"); using (new UL(stream, HtmlAttributes.@class, "dropdown-menu", "role", "menu")) { foreach (MarketRow m in allMarkets.Where(m => !m.flipped)) { WriteLiHref(stream, CurrencyHelpers.RenameSymbolPair(m.symbol_pair), "", "", HtmlAttributes.href, "/markets/" + CurrencyHelpers.RenameSymbolPair(m.symbol_pair)); } } } //WriteLiHref(stream, "Home", GetLiClass(page, ""), "", HtmlAttributes.href, "/"); WriteLiHref(stream, "Api", GetLiClass(page, "apiDocs"), "", HtmlAttributes.href, "/apiDocs"); WriteLiHref(stream, "Faq", GetLiClass(page, "faq"), "", HtmlAttributes.href, "/faq"); } } } } return(null); }
/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="ctx"></param> /// <param name="stream"></param> /// <param name="authObj"></param> /// <returns></returns> public override Task Render(RequestContext ctx, StringWriter stream, IDummy authObj) { #if !MONO foreach (string name in m_sharedJsFilenames) { AddResource(new JsResource(Constants.kWebRoot, name, true)); } #endif AddResource(new CssResource(Constants.kWebRoot, "/css/site.css", true)); AddResource(new CssResource(Constants.kWebRoot, "/css/bootstrap.min.css", true)); AddResource(new FavIconResource(Constants.kWebRoot, "/images/favicon.ico")); AddResource(new TitleResource("Metaexchange")); AddResource(new MetaResource("viewport", "width=device-width, initial-scale=1")); ImgResource brand = new ImgResource(Constants.kWebRoot, "/images/brandTitle.png", "", false); AddResource(brand); // render head base.Render(ctx, stream, authObj); m_stream.WriteLine("<!-- Just for debugging purposes. Don't actually copy this line! --> <!--[if lt IE 9]><script src=\"../../assets/js/ie8-responsive-file-warning.js\"></script><![endif]--> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src=\"https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js\"></script> <script src=\"https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js\"></script><![endif]-->"); // begin body m_stream.WriteLine("<body>"); using (new DivContainer(m_stream, HtmlAttributes.@class, "navbar navbar-default navbar-fixed-top")) { using (new DivContainer(m_stream, HtmlAttributes.@class, "container")) { using (new DivContainer(m_stream, HtmlAttributes.@class, "navbar-header")) { using (new Link(m_stream, HtmlAttributes.@class, "navbar-brand", HtmlAttributes.href, "/")) { brand.Write(m_stream); m_stream.Write(" metaexchange"); } } using (new DivContainer(m_stream, HtmlAttributes.@class, "navbar-collapse collapse")) { string page = ctx.Request.Url.LocalPath.Split('/').Last(); IEnumerable<MarketRow> allMarkets = authObj.m_database.GetAllMarkets().Where(m=>m.visible); using (var ul = new UL(stream, "nav navbar-nav pull-left")) { using (var li = new LI(stream, "dropdown")) { Href(stream, "Markets <span class=\"caret\">", HtmlAttributes.href, "/", HtmlAttributes.@class, "disabled", "data-toggle", "dropdown", "role", "button", "aria-expanded", "false"); using (new UL(stream, HtmlAttributes.@class, "dropdown-menu", "role","menu")) { foreach (MarketRow m in allMarkets.Where(m=>!m.flipped)) { WriteLiHref(stream, CurrencyHelpers.RenameSymbolPair(m.symbol_pair), "", "", HtmlAttributes.href, "/markets/" + CurrencyHelpers.RenameSymbolPair(m.symbol_pair)); } } } //WriteLiHref(stream, "Home", GetLiClass(page, ""), "", HtmlAttributes.href, "/"); WriteLiHref(stream, "Api", GetLiClass(page, "apiDocs"), "", HtmlAttributes.href, "/apiDocs"); WriteLiHref(stream, "Faq", GetLiClass(page, "faq"), "", HtmlAttributes.href, "/faq"); } } } } return null; }
/// <summary> /// Insert a text to scrollback list /// </summary> /// <param name="text">Text</param> /// <param name="InputStyle">Style</param> /// <param name="WriteLog">Write to a log</param> /// <param name="Date">Date</param> /// <param name="SuppressPing">Suppress highlight</param> /// <param name="IgnoreUpdate"></param> /// <returns></returns> private bool insertText(string text, Client.ContentLine.MessageStyle InputStyle, bool WriteLog = true, long Date = 0, bool SuppressPing = false, bool IgnoreUpdate = false) { // we need to finish the previous partial line if (!IsEmtpy) { Flush(); } // in case there are multiple lines we call this function for every line if (text.Contains('\n')) { string[] data = text.Split('\n'); foreach (string Next in data) { InsertText(Next, InputStyle, WriteLog, Date, SuppressPing); } return true; } if (owner != null && owner.MicroBox) { Core.SystemForm.micro.scrollback_mc.InsertText("{" + owner.WindowName + "} " + text, InputStyle, false, Date); } bool Matched = false; if (!SuppressPing) { Matched = Match(text); } if (Matched && owner != null && owner.Highlights) { if (Hooks._Scrollback.NotificationDisplay(text, InputStyle, ref WriteLog, Date, ref SuppressPing)) { Core.DisplayNote(text, owner.WindowName); } } if (!IgnoreUpdate && owner != null && owner != Core.SystemForm.Chat && owner._Network != null && owner._Network._Protocol != null && !owner._Network._Protocol.SuppressChanges) { switch (InputStyle) { case ContentLine.MessageStyle.Kick: case ContentLine.MessageStyle.System: owner.MenuColor = Configuration.CurrentSkin.HighlightColor; break; case ContentLine.MessageStyle.Message: if (owner.MenuColor != Configuration.CurrentSkin.HighlightColor) { owner.MenuColor = Configuration.CurrentSkin.ColorTalk; } break; case ContentLine.MessageStyle.Action: if (owner.MenuColor != Configuration.CurrentSkin.ColorTalk && owner.MenuColor != Configuration.CurrentSkin.HighlightColor) { owner.MenuColor = Configuration.CurrentSkin.MiscelancsColor; } break; case ContentLine.MessageStyle.Part: case ContentLine.MessageStyle.Channel: case ContentLine.MessageStyle.User: case ContentLine.MessageStyle.Join: if (owner.MenuColor != Configuration.CurrentSkin.HighlightColor && owner.MenuColor != Configuration.CurrentSkin.MiscelancsColor && owner.MenuColor != Configuration.CurrentSkin.ColorTalk) { owner.MenuColor = Configuration.CurrentSkin.JoinColor; } break; } Graphics.PidgeonList.Updated = true; if (Matched) { owner.MenuColor = Configuration.CurrentSkin.HighlightColor; } } DateTime time = DateTime.Now; if (Date != 0) { time = DateTime.FromBinary(Date); } ContentLine line = new ContentLine(InputStyle, text, time, Matched); lock (ContentLines) { ContentLines.Add(line); if (Date != 0) { SortNeeded = true; } } if (WriteLog == true) { if (owner != null && owner._Network != null) { if (logs.Count > 0) { lock (logs) { foreach (LI item in logs) { LineLogs.Log(item.text, item.style, owner, LogfilePath, item.date); } logs.Clear(); } } LineLogs.Log(text, InputStyle, owner, LogfilePath, time); } else { LI item = new LI(); item.text = text; item.style = InputStyle; item.date = time; lock (logs) { if (logs.Count > 100) { Core.DebugLog("Buffer overflow: more than 100 items waiting to be written to log: auto flushing"); logs.Clear(); } logs.Add(item); } } } Changed = true; if (Thread.CurrentThread == Core._KernelThread && (!Configuration.Scrollback.DynamicReload || WindowVisible())) { if (!RequireReload(time)) { InsertLineToText(line); lastDate = time; } else { SortNeeded = true; Reload(true); } } else { if (!RequireReload(time)) { lock (UndrawnLines) { if (!UndrawnLines.Contains(line)) { UndrawnLines.Add(line); } } lastDate = time; } else { SortNeeded = true; ReloadWaiting = true; } } return false; }
protected void btnAccept_Click(object sender, EventArgs e) { string confirmValue = Request.Form["confirm_value"]; if (confirmValue == "Yes") { List <string> Errors = new List <string>(); if (ddlAssignClass.SelectedIndex != -1) { foreach (GridViewRow row in gvAllocateStudents.Rows) { if (((CheckBox)row.FindControl("CBUser")).Checked) { gvAllocateStudents.SelectedIndex = row.DataItemIndex; string UserID = gvAllocateStudents.SelectedDataKey.Value.ToString(); myDal.ClearParams(); myDal.AddParam("@UserID", UserID); myDal.AddParam("@ClassID", ddlAssignClass.SelectedValue.ToString()); DataSet ds = myDal.ExecuteProcedure("SD18EXAM_spAllocateStudent"); if (ds.Tables[0].Rows.Count != 0) { if (ds.Tables[0].Rows[0]["status"] != null) { switch (ds.Tables[0].Rows[0]["status"].ToString()) { case "UserNotFound": Errors.Add("User Not Found: " + gvAllocateStudents.SelectedDataKey.Value.ToString()); break; case "Failed": Errors.Add("Operation Failed at USERID: " + gvAllocateStudents.SelectedDataKey.Value.ToString()); break; default: break; } } else { Response.Write("<SCRIPT>alert('Error in Retrieving values on database. Please Try again.')</SCRIPT>"); } } else { Response.Write("<SCRIPT>alert('Error in Retrieving values on database. Please Try again.')</SCRIPT>"); } } } if (Errors.Count != 0) { foreach (string LI in Errors) { Response.Write("<SCRIPT>alert('" + LI.ToString() + "')</SCRIPT>"); } } } else { Response.Write("<SCRIPT>alert('Please select class to assign')</SCRIPT>"); } } refreshStudentGrid(); }