public T3(T4 t4, Scoped1 scoped1, Scoped3 scoped3, Single3 single3) { T4 = t4; Scoped1 = scoped1; Scoped3 = scoped3; Single3 = single3; }
private Dictionary <Tuple <T1, T2, T3, T4>, int> CollectKeys4 <T1, T2, T3, T4>() { Debug.Assert(_keyColumns.Length == 4); var column1 = _dataMap[_keyColumns[0]].UnderlyingList; var column2 = _dataMap[_keyColumns[1]].UnderlyingList; var column3 = _dataMap[_keyColumns[2]].UnderlyingList; var column4 = _dataMap[_keyColumns[3]].UnderlyingList; var rowCount = _dataMap.MaxRowCount; var result = new Dictionary <Tuple <T1, T2, T3, T4>, int>(rowCount); for (var i = 0; i < rowCount; ++i) { T1 k1 = i >= column1.Count ? TypeTrait <T1> .GetNaN() : (T1)column1[i]; T2 k2 = i >= column2.Count ? TypeTrait <T2> .GetNaN() : (T2)column2[i]; T3 k3 = i >= column3.Count ? TypeTrait <T3> .GetNaN() : (T3)column3[i]; T4 k4 = i >= column4.Count ? TypeTrait <T4> .GetNaN() : (T4)column4[i]; var key = Tuple.Create(k1, k2, k3, k4); try { result.Add(key, i); } catch (ArgumentException ex) { throw new ArgumentException($"Duplicate key values: {key}", ex); } } return(result); }
public Scoped1(T4 t4, Scoped2 scoped2, Func1 func1, Single1 single1) { T4 = t4; Scoped2 = scoped2; Func1 = func1; Single1 = single1; }
public U Reduce(IEnumerable <T> list) { List <T4> prepared = list.Select(MitsPrepare).ToList(); T4 final = prepared.Aggregate(MitsCombine); return(Ex(final)); }
public void TestIndexing3() { var a = new NativeArrayFullSOA <T4>(150, Allocator.Temp); for (int i = 0; i < a.Length; ++i) { a[i] = new T4 { A = new T3 { A = i, B = new T2 { A = i * 13, B = 900 - i * 3 } }, B = new T2 { A = i * 33, B = 900 - i * 5 }, }; } for (int i = 0; i < a.Length; ++i) { var e = a[i]; Assert.AreEqual(i, e.A.A); Assert.AreEqual(i * 13, e.A.B.A); Assert.AreEqual(900 - i * 3, e.A.B.B); Assert.AreEqual(i * 33, e.B.A); Assert.AreEqual(900 - i * 5, e.B.B); } a.Dispose(); }
public Scoped2(T4 t4, Scoped3 scoped3, Func2 func2, Single2 single2, Single3 single3) { T4 = t4; Scoped3 = scoped3; Func2 = func2; Single2 = single2; Single3 = single3; }
void Start() { N = 1; T1.SetActive(true); T2.SetActive(false); T3.SetActive(false); T4.SetActive(false); }
// This is transcribed directly from [Emoto] p. 568 private T4 MitsCombine(T4 a, T4 b) { U m = _semiring.Add(_semiring.Add(a.m, _semiring.Mult(a.t, b.i)), b.m); U i = _semiring.Add(a.i, _semiring.Mult(a.s, b.i)); U t = _semiring.Add(_semiring.Mult(a.t, b.s), b.t); U s = _semiring.Mult(a.s, b.s); return(new T4(m, i, t, s)); }
public void Run() { CliSendWork = SrvSendWork = false; CliRecvWork = SrvRecvWork = false; T1.Start(); T2.Start(); T3.Start(); T4.Start(); }
public YAMLNode ExportYAML() { YAMLMappingNode node = new YAMLMappingNode(); node.Add("t", IsVector3 ? T3.ExportYAML() : T4.ExportYAML()); node.Add("q", Q.ExportYAML()); node.Add("s", IsVector3 ? S3.ExportYAML() : S4.ExportYAML()); return(node); }
public T2(T3 t3, T4 t4, Scoped1 scoped1, Scoped3 scoped3, Single1 single1, Single2 single2) { T3 = t3; T4 = t4; Scoped1 = scoped1; Scoped3 = scoped3; Single1 = single1; Single2 = single2; }
public void Execute() { T4 t4 = new T4(); for (int i = 0; i < array.Length; i++) { t4.A.A = i; array[i] = t4; } }
/// <summary> /// Delegate method /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> /// <param name="arg3"></param> /// <param name="arg4"></param> /// <returns></returns> public TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4) { var newContext = _context?.Clone() ?? _injectionContextCreator.CreateContext(null); newContext.SetExtraData(_arg1Id, arg1); newContext.SetExtraData(_arg2Id, arg2); newContext.SetExtraData(_arg3Id, arg3); newContext.SetExtraData(_arg4Id, arg4); return((TResult)_action(_scope, _disposalScope, newContext)); }
public ActionResult Index(BasePagerModel pager) { if (!User.Identity.IsAuthenticated) { return(RedirectToRoute(new { controller = "Login", action = "LogOut" })); } int uid = PageValidate.FilterParam(User.Identity.Name); if (!RoleCheck.CheckHasAuthority(uid, db, "用户管理")) { return(RedirectToRoute(new { controller = "Error", action = "Index", err = "没有权限。" })); } if (pager == null) { pager = new BasePagerModel(); } ViewData["search"] = pager; var list = (from user in db.User_Info join uvr in db.User_vs_Role on user.user_id equals uvr.uvr_user_id into T1 from t1 in T1.DefaultIfEmpty() join role in db.Dic_Role on t1.uvr_role_id equals role.role_id into T2 from t2 in T2.DefaultIfEmpty() join ue in db.User_Extend on user.user_id equals ue.user_id into T3 from t3 in T3.DefaultIfEmpty() join dept in db.Dic_Department on t3.user_dept_id equals dept.dept_id into T4 from t4 in T4.DefaultIfEmpty() join post in db.Dic_Post on t3.user_post_id equals post.post_id into T5 from t5 in T5.DefaultIfEmpty() orderby user.user_id ascending select new UserListModel { id = user.user_id, name = user.user_name, roleName = t2.role_name == null?"":t2.role_name, stateTxt = user.user_state == 1 ? "正常" : (user.user_state == 2 ? "锁定" : (user.user_state == 0 ? "未启用" : "未知")), realName = user.real_name, times = user.user_login_times, deptName = t4.dept_name == null?"":t4.dept_name, postName = t5.post_name == null?"":t5.post_name, picture = t3.user_picture == null?"default.jpg":t3.user_picture, loginTimes = user.user_login_times }).Skip((pager.PageIndex - 1) * pager.PageSize).Take(pager.PageSize).ToList(); foreach (var item in list) { item.realName = Common.DEncrypt.AESEncrypt.Decrypt(item.realName); } return(View(list)); }
public Topographer(Polyline outline, Polyline[] islands) { _outline = outline; _islands = islands; Point3F min = Point3F.Undefined; Point3F max = Point3F.Undefined; _outline.GetExtrema(ref min, ref max); _t4 = new T4(new T4_rect(min.X - T4_MARGIN, min.Y - T4_MARGIN, max.X + T4_MARGIN, max.Y + T4_MARGIN)); }
public void SequenceInChoice() { var particle = new CompositeParticle.Builder(ParticleType.Choice, 0, 1) { new ElementParticle(typeof(T1), 0, 1), new CompositeParticle.Builder(ParticleType.Sequence, 0, 1) { new ElementParticle(typeof(T2), 0, 1), new ElementParticle(typeof(T3), 0, 1), }, new ElementParticle(typeof(T4), 0, 1), }.Compile(); var data = new TestOpenXmlCompositeElement(); var t1 = new T1(); var t2 = new T2(); var t3 = new T3(); var t4 = new T4(); Assert.True(particle.Set(data, t1)); Assert.Collection( data, e => Assert.Same(t1, e)); Assert.True(particle.Set(data, t2)); Assert.Collection( data, e => Assert.Same(t2, e)); Assert.True(particle.Set(data, t3)); Assert.Collection( data, e => Assert.Same(t2, e), e => Assert.Same(t3, e)); Assert.True(particle.Set(data, t4)); Assert.Collection( data, e => Assert.Same(t4, e)); Assert.True(particle.Set(data, t3)); Assert.Equal(new object[] { t3 }, data.ToArray()); Assert.Collection( data, e => Assert.Same(t3, e)); Assert.True(particle.Set(data, t2)); Assert.Collection( data, e => Assert.Same(t2, e), e => Assert.Same(t3, e)); }
public void SendMessage(object clientSocket) { // while (true) // { Socket myClientSocket = (Socket)clientSocket; Message c = DealMsg7(Encoding.Unicode.GetString(result)); //MessageBox.Show(c.type); if (c.type == "05") { //Message b = new Message(); c.msg5_Au_TS5 = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); //this.Dispatcher.Invoke(new Action(() => { TextBox1.AppendText(c.msg2_TS2); })); this.Dispatcher.Invoke(new Action(() => { T3.AppendText(c.MMessage5(c)); })); DateTime ssmg = DateTime.Parse(c.msg5_Au_TS5).AddSeconds(1); this.Dispatcher.Invoke(new Action(() => { T5.AppendText(ssmg.ToString("yyyy/MM/dd HH:mm:ss")); })); // this.Dispatcher.Invoke(new Action(() => { TextBox1.AppendText(ssmg.Length.ToString()); })); string Cssmg; Cssmg = ssMessage(c); this.Dispatcher.Invoke(new Action(() => { T4.AppendText(Cssmg); })); Byte[] ssmg1 = new byte[1024]; ssmg1 = Encoding.ASCII.GetBytes(Cssmg); //int num1 = myClientSocket.Send(ssmg1); myClientSocket.Send(ssmg1, ssmg1.Length, 0); // Thread sendThread = new Thread(SendMessage); // sendThread.Start(myClientSocket); // myClientSocket.Close(); } if (c.type == "09") { // MessageBox.Show(c.msg1_IDc); string ssmg; ssmg = ssMessage12(c); //MessageBox.Show(ssmg); Byte[] ssmg1 = new byte[1024]; ssmg1 = Encoding.Unicode.GetBytes(ssmg); myClientSocket.Send(ssmg1, ssmg1.Length, 0); // myClientSocket.Close(); } if (c.type == "07") { string ssmg; ssmg = ssMessage8(c); //MessageBox.Show(ssmg); Byte[] ssmg1 = new byte[2048]; ssmg1 = Encoding.Unicode.GetBytes(ssmg); myClientSocket.Send(ssmg1, ssmg1.Length, 0); //myClientSocket.Close(); } // myClientSocket.Close(); //} }
static T4 ParsingT4(string sBit) { //Console.WriteLine ("len: {1}, sBit: {0}", sBit, sBit.Length); T4 stt = new T4(); stt.type = Convert.ToUInt16(bin2int(sBit.Substring(0, 6))); stt.repeat = Convert.ToUInt16(bin2int(sBit.Substring(6, 2))); stt.mmsi = Convert.ToUInt32(bin2int(sBit.Substring(8, 30))); stt.year = Convert.ToUInt16(bin2int(sBit.Substring(38, 14))); stt.month = Convert.ToUInt16(bin2int(sBit.Substring(52, 4))); stt.day = Convert.ToUInt16(bin2int(sBit.Substring(56, 5))); stt.hour = Convert.ToUInt16(bin2int(sBit.Substring(61, 5))); stt.minute = Convert.ToUInt16(bin2int(sBit.Substring(66, 6))); stt.second = Convert.ToUInt16(bin2int(sBit.Substring(72, 6))); stt.accuracy = Convert.ToBoolean(bin2int(sBit.Substring(78, 1))); bool west = Convert.ToBoolean(bin2int(sBit.Substring(79, 1))); UInt32 lon = Convert.ToUInt32(bin2int(sBit.Substring(79, 28))); stt.lon = getPos(lon, west, true); bool south = Convert.ToBoolean(bin2int(sBit.Substring(107, 1))); UInt32 lat = Convert.ToUInt32(bin2int(sBit.Substring(107, 27))); stt.lat = getPos(lat, south, false); stt.epfd = Convert.ToUInt16(bin2int(sBit.Substring(134, 4))); stt.raim = Convert.ToBoolean(bin2int(sBit.Substring(148, 1))); stt.radio = Convert.ToUInt32(bin2int(sBit.Substring(149, 19))); #if DISP_DEBUG Console.WriteLine("tip: {0}", stt.type); Console.WriteLine("rep: {0}", stt.repeat); Console.WriteLine("mss: {0}", stt.mmsi); Console.WriteLine("yea: {0}", stt.year); Console.WriteLine("mon: {0}", stt.month); Console.WriteLine("day: {0}", stt.day); Console.WriteLine("hou: {0}", stt.hour); Console.WriteLine("min: {0}", stt.minute); Console.WriteLine("sec: {0}", stt.second); Console.WriteLine("lon: {0}", stt.lon); Console.WriteLine("lat: {0}", stt.lat); Console.WriteLine("epf: {0}", stt.epfd); Console.WriteLine("rai: {0}", stt.raim); Console.WriteLine("rad: {0}", stt.radio); #endif return(stt); }
private void calc() { try { T1 = Convert.ToDateTime(txt1.Text); T2 = Convert.ToDateTime(txt2.Text); T3 = Convert.ToDateTime(txt3.Text); T4 = Convert.ToDateTime(txt4.Text); TimeSpan manha = T2.Subtract(T1); TimeSpan tarde = T4.Subtract(T3); lblHorasTrab.Text = tarde.Add(manha).ToString(); } catch { } }
public override int GetHashCode() { var hashCode = 2018318558; hashCode = hashCode * -1521134295 + T1.GetHashCode(); hashCode = hashCode * -1521134295 + T2.GetHashCode(); hashCode = hashCode * -1521134295 + T3.GetHashCode(); hashCode = hashCode * -1521134295 + T4.GetHashCode(); hashCode = hashCode * -1521134295 + T5.GetHashCode(); hashCode = hashCode * -1521134295 + P1.GetHashCode(); hashCode = hashCode * -1521134295 + P2.GetHashCode(); hashCode = hashCode * -1521134295 + P3.GetHashCode(); hashCode = hashCode * -1521134295 + P4.GetHashCode(); hashCode = hashCode * -1521134295 + P5.GetHashCode(); hashCode = hashCode * -1521134295 + JunctionIndex.GetHashCode(); hashCode = hashCode * -1521134295 + NearestJunctionIndex.GetHashCode(); return(hashCode); }
private void Clear(object sender, RoutedEventArgs e) { T1.Clear(); T2.Clear(); T3.Clear(); T4.Clear(); T5.Clear(); T6.Clear(); T7.Clear(); T8.Clear(); T9.Clear(); T10.Clear(); T11.Clear(); T12.Clear(); T13.Clear(); T14.Clear(); T15.Clear(); T16.Clear(); T17.Clear(); }
public void Read(AssetReader reader) { if (IsVector3(reader.Version)) { T = reader.ReadAsset <Vector3f>(); } else { T4.Read(reader); } Q.Read(reader); if (IsVector3(reader.Version)) { S = reader.ReadAsset <Vector3f>(); } else { S4.Read(reader); } }
public void Read(EndianStream stream) { if (IsVector3) { T3.Read(stream); } else { T4.Read(stream); } Q.Read(stream); if (IsVector3) { S3.Read(stream); } else { S4.Read(stream); } }
public override int GetHashCode() { var hashCode = -1044093539; hashCode = hashCode * -1521134295 + T1.GetHashCode(); hashCode = hashCode * -1521134295 + T2.GetHashCode(); hashCode = hashCode * -1521134295 + T3.GetHashCode(); hashCode = hashCode * -1521134295 + T4.GetHashCode(); hashCode = hashCode * -1521134295 + T5.GetHashCode(); hashCode = hashCode * -1521134295 + P1.GetHashCode(); hashCode = hashCode * -1521134295 + P2.GetHashCode(); hashCode = hashCode * -1521134295 + P3.GetHashCode(); hashCode = hashCode * -1521134295 + P4.GetHashCode(); hashCode = hashCode * -1521134295 + P5.GetHashCode(); hashCode = hashCode * -1521134295 + JunctionIndex.GetHashCode(); hashCode = hashCode * -1521134295 + NearestJunctionIndex.GetHashCode(); hashCode = hashCode * -1521134295 + Length.GetHashCode(); hashCode = hashCode * -1521134295 + Lock.GetHashCode(); return(hashCode); }
public static float EaseEvaluate(float time, int mode) { if (time >= 1.0) { return(1.0f); } else if (time <= 0.0) { return(0.0f); } switch (mode) { case 1: return(T1.Evaluate(time)); case 2: return(T2.Evaluate(time)); case 3: return(T3.Evaluate(time)); case 4: return(T4.Evaluate(time)); case 5: return(T5.Evaluate(time)); case 6: return(T6.Evaluate(time)); case 7: return(T7.Evaluate(time)); case 8: return(T8.Evaluate(time)); case 9: return(T9.Evaluate(time)); case 10: return(T10.Evaluate(time)); case 11: return(T11.Evaluate(time)); case 12: return(T12.Evaluate(time)); default: return(time); } }
public MainGame() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; this.Window.Title = "XNA"; this.IsFixedTimeStep = false; this.IsMouseVisible = true; graphics.SynchronizeWithVerticalRetrace = true; this.SetScreenMode(); this.previousKeyboard = Keyboard.GetState(); this.tryb1 = new T1(this); Components.Add(this.tryb1); this.tryb2 = new T2(this); Components.Add(this.tryb2); this.tryb3 = new T3(this); Components.Add(this.tryb3); this.tryb4 = new T4(this); Components.Add(this.tryb4); this.tryb5 = new T5(this); Components.Add(this.tryb5); this.textField = new TextArea(this); Components.Add(this.textField); FPS = new FpsCounter(); TIME = new TimeCounter(); sw = new Stopwatch(); }
protected void ImageButton5_Click(object sender, ImageClickEventArgs e) { T.Text = ""; T.Focus(); T1.Text = ""; T1.Focus(); T2.Text = ""; T2.Focus(); T3.Text = ""; T3.Focus(); T4.Text = ""; T4.Focus(); T5.Text = ""; T5.Focus(); T6.Text = ""; T6.Focus(); T7.Text = ""; T7.Focus(); T8.Text = ""; T8.Focus(); T9.Text = ""; T9.Focus(); }
private void textBox1_KeyDown(object sender, KeyEventArgs e) { var c = (Control)sender; if (e.KeyData == Keys.OemPeriod || e.KeyData == Keys.Decimal) { switch (c.Name) { case "T1": T2.Focus(); break; case "T2": T3.Focus(); break; case "T3": T4.Focus(); break; } e.SuppressKeyPress = true; } }
// Update is called once per frame void Update() { if (N > 4) { N = 1; } if (N == 1) { T1.SetActive(true); T2.SetActive(false); T3.SetActive(false); T4.SetActive(false); } else if (N == 2) { T1.SetActive(false); T2.SetActive(true); T3.SetActive(false); T4.SetActive(false); } else if (N == 3) { T1.SetActive(false); T2.SetActive(false); T3.SetActive(true); T4.SetActive(false); } else if (N == 4) { T1.SetActive(false); T2.SetActive(false); T3.SetActive(false); T4.SetActive(true); } }
private String Step(T4 s, String inp) { Char c; try { c = PreStep(ref inp); } catch (EndOfStringException) { return(""); } if (DECIMAL.Contains(c)) { return(c.ToString() + Step(new T4(), inp)); } else if (POINT.Contains(c)) { return(c.ToString() + Step(new T5(), inp));; } throw new CannotParseException(); }
static bool Do4(T4 t) { Nullable<T4> n = new Nullable<T4>(t); return Ensure(n.HasValue && n.Value == t); }