public static void AddRange <T>(this Dumb <T> source, IEnumerable <T> items) { foreach (var item in items) { source.Add(item); } }
public static void Main(string[] args) { //var DataPorcessing = new DataProcess("/Users/renhaoran/RiderProjects/MasterResearch/QuantModel/DataProcessing/Data.txt"); //var Close = DataPorcessing.GetClose(); var Close = new Dumb <double>(); var macd = Close.MACD(12, 26, 9); var l = Close.GetNexts(); Close.AddRange(1, 2, 3, 4, 5, 6); Close.PrintTree(); Console.WriteLine("hello world"); }
public Dumb <double> GetSource(int Type) { string Line; var Source = new Dumb <Double>(); Source.FollowUp(); List <string> List1 = new List <string>(); while ((Line = Sr.ReadLine()) != null) { string[] Temp = Line.Split(','); Source.Add(Double.Parse(Temp[Type])); } return(Source); }
void Publish(Dumb.CliendModelEvent e) { if (!_loadingCompleted) return; _queue.Enqueue(e); }
public static void AddRange <T>(this Dumb <T> source, params T[] items) => source.AddRange(items.AsEnumerable());
private static void MakeTableBytes <T>(ref T l, string examPath) { Type tipo = l.GetType(); byte[] arr2 = null; // string afile = string.Empty; if (tipo.Equals(typeof(ExamsListRow))) { ExamsListRow ls = l as ExamsListRow; IEnumerable <ExamsRow> rows = ls.GetExamsRows(); ExamsDataTable exdt = new ExamsDataTable(); foreach (var item in rows) { exdt.ImportRow(item); } // afile = ExasmPath + ls.EID.ToString(); arr2 = Tables.MakeDTBytes(ref exdt, examPath); ls.EData = arr2; } else if (tipo.Equals(typeof(ExamsRow))) { //SAVE COPY OF TABLE ExamsRow ex = l as ExamsRow; QuestionsRow q = ex.QuestionsRow; // afile = ExasmPath + ex.QID.ToString(); IEnumerable<DB.QuestionsRow> shortQlist = // new List<DB.QuestionsRow>(); ((IList<DB.QuestionsRow>)shortQlist).Add(ex.QuestionsRow); QuestionsDataTable qdt = new QuestionsDataTable(); qdt.ImportRow(q); byte[] qarray = Tables.MakeDTBytes(ref qdt, examPath); ex.QData = qarray; Dumb.FD(ref qdt); AnswersDataTable adt = new AnswersDataTable(); IEnumerable <AnswersRow> answ = q.GetAnswersRows(); foreach (var item in answ) { adt.ImportRow(item); } // afile = ExasmPath + ex.QueToString() + ".xml"; arr2 = Tables.MakeDTBytes(ref adt, examPath); ex.AData = arr2; Dumb.FD(ref adt); } else if (tipo.Equals(typeof(PreferencesRow))) { PreferencesRow p = l as PreferencesRow; //SAVE A COPY OF EXAMS LISTS IEnumerable <DB.ExamsListRow> rows = p.GetExamsListRows(); ExamsListDataTable dt = new ExamsListDataTable(); foreach (var item in rows) { dt.ImportRow(item); } // afile = ExasmPath + p.PID.ToString() + ".xml"; arr2 = Tables.MakeDTBytes(ref dt, examPath); p.ELData = arr2; Dumb.FD(ref dt); } }