private void Start() { init = GameObject.Find("Initial").GetComponent <Initial>(); //다른컴포넌트 받아오기위한 선언 }
public static XafApplication NewApplication <TModule>(this Platform platform, bool transmitMessage = true, bool handleExceptions = true, bool usePersistentStorage = false) where TModule : ModuleBase { XafApplication application; if (platform == Platform.Web) { application = new TestWebApplication(typeof(TModule), transmitMessage); } else if (platform == Platform.Win) { application = new TestWinApplication(typeof(TModule), transmitMessage, handleExceptions); } else { throw new NotSupportedException( "if implemented make sure all tests pass with TestExplorer and live testing"); } application.Title = TestContext.CurrentContext.Test.FullName; application.ConnectionString = usePersistentStorage? @$ "Integrated Security=SSPI;Pooling=false;Data Source=(localdb)\mssqllocaldb;Initial Catalog={typeof(TModule).Name}":InMemoryDataStoreProvider.ConnectionString; application.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways; application.CheckCompatibilityType = CheckCompatibilityType.DatabaseSchema; application.ConfigureModel <TModule>(transmitMessage).SubscribeReplay(); application.MockEditorsFactory(); if (application is WebApplication webApplication) { var frameTemplateFactoryMock = new Mock <IFrameTemplateFactory>(); var frameTemplateMock = new Mock <System.Web.UI.Control>() { CallBase = true }.As <IFrameTemplate>(); frameTemplateMock.Setup(template => template.GetContainers()).Returns(new ActionContainerCollection()); frameTemplateFactoryMock.Setup(factory => factory.CreateTemplate(It.IsAny <TemplateContext>())).Returns( (TemplateContext context) => { if (context == TemplateContext.NestedFrame) { return((IFrameTemplate)frameTemplateMock.As <ISupportActionsToolbarVisibility>().Object); } return(frameTemplateMock.Object); }); webApplication.FrameTemplateFactory = frameTemplateFactoryMock.Object; } else { ((WinApplication)application).UseLightStyle = true; } return(application); }
public void Received(string str) { var handle = str.Split(' ')[0].Trim('/'); var data = str.Remove(0, str.IndexOf(' ')); Console.WriteLine("handle " + handle); try { switch (handle) { case ActionTicket.INITIAL: if (isInitial) { Initial dataUser = JsonConvert.DeserializeObject <Initial>(data); EventSocketSendProgram eventSend = new EventSocketSendProgram(ActionTicket.INITIAL, null, dataUser.Counters, dataUser.Serving, null); Thread.Sleep(2000); DataReceived(eventSend); } break; case ActionTicket.ASSETS: if (isInitial) { isInitial = false; var voice = JsonConvert.DeserializeObject <List <Asset> >(data); if (voice.Count() > 0) { EventSocketSendProgram eventSend1 = new EventSocketSendProgram(ActionTicket.ASSETS, null, null, null, voice[0].voice); DataReceived(eventSend1); } } break; case ActionTicket.TICKET_ACTION: var tkAc = JsonConvert.DeserializeObject <TicketActionRecive>(data); string action = tkAc.action; switch (action) { case ActionTicket.ACTION_FEEDBACK: break; case ActionTicket.ACTION_MOVE: Ticket tk = tkAc.ticket; tk.counter_id = tkAc.counter_id; EventSocketSendProgram eventSendMove = new EventSocketSendProgram(action, tk, null, null, null); DataReceived(eventSendMove); break; case ActionTicket.ACTION_FINISH: case ActionTicket.ACTION_CANCEL: case ActionTicket.ACTION_RECALL: case ActionTicket.ACTION_CALL: string counterID = tkAc.ticket.counter_id; string cnum = tkAc.ticket.cnum; string ticketID = tkAc.ticket.id; EventSocketSendProgram eventSendTK = new EventSocketSendProgram(action, tkAc.ticket, null, null, null); DataReceived(eventSendTK); break; default: break; } break; case ActionTicket.RELOAD: isReload = true; SetThreadExecutionState(ES_CONTINUOUS); Thread.Sleep(500); EventSocketSendProgram eventSendReload = new EventSocketSendProgram(ActionTicket.RELOAD, null, null, null, null); DataReceived(eventSendReload); CloseSocket(); // khi close sẽ tự mở break; default: break; } } catch (Exception ex) { Console.WriteLine("Loi send data" + ex.Message); } }
public static Elements.Dropdown.Dropdown Generate(Property property) { var dropdownInstance = property.Element as Elements.Dropdown.Dropdown; dropdownInstance.Options = InitialDropdownOptions(selectListItems: dropdownInstance.SelectListItems, dropdownSelectedValue: property.PropertyValue); dropdownInstance.Rendered = GenerateDropdownBody(dropdown: dropdownInstance) + Initial.RenderErrorElements(errorElements: property.ErrorElements); return(dropdownInstance); }
// Use this for initialization void Awake() { _vector = GameObject.Find("Initial").GetComponent <Initial>(); //다른컴포넌트 받아오기위한 선언 }
/// <summary> /// 从戚林八音的声韵母推导出现代福州市区读音。假定声调为上平。 /// /// 现代福州市区读音用榕拼 0.4.0 表示。 /// /// https://yngping.zingzeu.org/spec/v0.4.0-preview2/hukziu.html /// </summary> /// <returns>推测的现代福州市区读音。不含声调。</returns> public static string ToYngPingHokchewToneless(Initial initial, Final final) { return(CikLingInitialToYngPing[initial] + GetYngPingHokchewFinal( MaybeYoToUo(initial, final), Tone.UpLevel)); }
public ProcedureHelper() { connectionString = Data Source = HOANGIT7; Initial Catalog = DbPratice; Integrated Security = True; }
public bool Accepts(string input) { var finalState = Initial.Compute(input); return(AcceptStates.Contains(finalState)); }
protected void btnLogin_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection("Data Source=ARIF-PC\SQLEXPRESS;Initial Catalog=Giftz;Integrated Security=True"); con.Open(); string query = "sp_checkLogin"; SqlCommand cmd = new SqlCommand(query, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@user", txtLoginID.Text); cmd.Parameters.AddWithValue("@pass", txtPassword.Text); string output = cmd.ExecuteScalar().ToString(); if (output == "1") { Response.Redirect(""); } else { lbl_alert.Text = "failed"; con.Close(); } }
// GET: Student public ActionResult Index() { String connectionString = "<Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-WebApplication1-20170222054809.mdf;Initial Catalog=aspnet-WebApplication1-20170222054809;Integrated Security=True" providerName = "System.Data.SqlClient/>"; String sql = "SELECT * FROM students"; SqlCommand cmd = new SqlCommand(sql, conn); var model = new List <Student>(); using (SqlConnection conn = new SqlConnection(connectionString)) { conn.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { var student = new Student(); student.FirstName = rdr["FirstName"]; student.LastName = rdr["LastName"]; student.Class = rdr["Class"]; model.Add(student); } } return(View(model)); }
/// <summary> /// Implements the activity. /// </summary> /// <param name="context"></param> protected override void Execute(NativeActivityContext context) { // set index to starting position current.Set(context, Initial.Get(context)); context.ScheduleFunc(Condition, current.Get(context), OnConditionCompleted); }
private void Start() { init = GameObject.Find("Initial").GetComponent <Initial>(); //다른컴포넌트 받아오기위한 선언 Debug.Log(init.vector.Count); }
public virtual void Reset() { Initial.Apply(Bone); }
public static string ToHanzi(Initial initial, Final final, Tone tone) { return(InitialToHanzi[initial] + FinalToHanzi[final] + " " + ToneToHanzi[tone]); }
public Dictionary <string, Dictionary <string, ObjectSend> > SetDataToObjectSend(Initial initial, TicketAction ticketAction, Dictionary <string, Service> dicServices) { string action = ""; Dictionary <string, Dictionary <string, ObjectSend> > dicObjSend = new Dictionary <string, Dictionary <string, ObjectSend> >(); Dictionary <string, ObjectSend> lstObjectWaiting = new Dictionary <string, ObjectSend>(); Dictionary <string, ObjectSend> lstObjectCanceled = new Dictionary <string, ObjectSend>(); Dictionary <string, ObjectSend> lstObjectServing = new Dictionary <string, ObjectSend>(); SetDataInSocketToHome setData = new SetDataInSocketToHome(); if (initial != null) { action = ActionTicket.INITIAL; foreach (var ticketDic in initial.Tickets) { var ticket = ticketDic.Value; var state = ticket.State; ObjectSend objSend = setData.SetDataFromTicketInitial(ticket, action, dicServices); AddList(state, lstObjectWaiting, lstObjectCanceled, lstObjectServing, objSend); } } else { action = ticketAction.Action; var state = ticketAction.Extra.Customer.state; ObjectSend objSend = setData.SetDataFromTicketAction(ticketAction, action, dicServices); AddList(state, lstObjectWaiting, lstObjectCanceled, lstObjectServing, objSend); } dicObjSend.Add(ActionTicket.STATE_WATING, lstObjectWaiting); dicObjSend.Add(ActionTicket.STATE_CANCELLED, lstObjectCanceled); dicObjSend.Add(ActionTicket.STATE_SERVING, lstObjectServing); return(dicObjSend); }
public SqlConnection Baglanti() { SqlConnection baglan = new SqlConnection(Data Source = LAPTOP - AK5T9PFP \ \ SQLEXPRESS; Initial Catalog = HastaneProje; Integrated Security = True); baglan.Open(); return(baglan); }
/// <summary> /// 从戚林八音的音韵地位推导出现代福州市区读音。 /// /// 现代福州市区读音用榕拼 0.4.0 表示。 /// /// https://yngping.zingzeu.org/spec/v0.4.0-preview2/hukziu.html /// </summary> public static string ToYngPingHokchew(Initial initial, Final final, Tone tone) { return(CikLingInitialToYngPing[initial] + GetYngPingHokchewFinal(MaybeYoToUo(initial, final), tone) + CikLingToneToYngPing[tone]); }
public static Evaluator Assert(int current) { return(new Evaluator(Initial.Evaluate(current), new List <string>())); }
private int UpdateStates() { return(Initial.Update()); }
private void Load() { DatachamcongDataContext db = new DatachamcongDataContext("Data Source=NVO1JL5GTOVLFWA\SQLEXPHLHR;Initial Catalog=HLHRDB;Integrated Security=True"); var dschamcong = db.CHAM }
private void Start() { init = GameObject.Find("Initial").GetComponent <Initial>(); //다른컴포넌트 받아오기위한 선언 guideflow_pos = GameObject.Find("GuideFlow").transform.position; Debug.Log(init.vector.Count); }
public override IList <Node> Solve() { int r = Initial.GetLength(0), c = Initial.GetLength(1); //Matrix<double> O = Matrix<double>.Build.Dense(r, c, 0), // I = Matrix<double>.Build.DenseDiagonal(r, c, 1), // B = Matrix<double>.Build.Dense(r, c, 0); //for (int i = 0; i < r; i++) //{ // B[i, i] = 1; // if (_isValid(B, i + 1, i)) // B[i + 1, i] = 1; // if (_isValid(B, i, i + 1)) // B[i, i + 1] = 1; //} //IList<Matrix<double>[]> list = new List<Matrix<double>[]>(); //for (int i = 0; i < r; i++) //{ // list.Add(_createRow(i, O, I, B)); //} //var A = Matrix<double>.Build.DenseOfMatrixArray(_createRectangularArray(list)); //var b = Matrix<double>.Build.Dense(r, c, 0); //var copy = Matrix<double>.Build.DenseOfMatrix(A); //Console.WriteLine(A); ////_reduce(A); //A = Matrix<double>.Build.DenseOfArray(_reduce(A.ToArray())); //Console.WriteLine(A); //var R = copy * A.Inverse(); //var result = Matrix<double>.Build.Dense(r, c, 0); //for (int i = 0; i < r; i++) //{ // for (int j = 0; j < c; j++) // { // result[i, j] = (int)(Math.Floor(R[i, j]) * (Initial[i, j] == Node.State.ON ? 1 : 0)); // } //} //IList<Node> nodes = new List<Node>(); //var last = new Node() { Board = Initial }; //nodes.Add(last); //result = result.Map(e => Math.Round(e)); //for (int i = 0; i < r; i++) //{ // for (int j = 0; j < c; j++) // { // if (result[i, j] >= 1) // { // var bb = last.Board.Clone() as Node.State[,]; // _click(bb, i, j); // var node = new Node() { Board = bb }; // nodes.Add(node); // last = node; // } // } //} //return nodes; int[] b = new int[r * c]; int index = 0; for (int i = 0; i < r; i++) { for (int j = 0; j < c; j++) { b[index++] = Initial[i, j]? 1 : 0; } } var ASize = r * c; var A = new MMatrix(ASize, ASize); for (int Arow = 0; Arow < ASize; Arow++) { for (int Acol = 0; Acol < ASize; Acol++) { int i, j, i_, j_ = 0; i = Arow / c; j = Arow % c; i_ = Acol / c; j_ = Acol % c; if (i_ >= 0 && i_ <= ASize && j_ >= 0 && j_ <= ASize) { if (Math.Abs(i - i_) + Math.Abs(j - j_) <= 1) { A.set(Arow, Acol, 1); } else { A.set(Arow, Acol, 0); } } } } for (int i = 0; i < b.Length; i++) { A.setBVector(i, 0, b[i]); } A.reducedRowEchelonForm(); Func <MMatrix, bool> canBeSolved = (m) => { for (int curr_Row = r * c - 1; curr_Row >= 0; curr_Row--) { for (int i = 0; i < r * c; i++) { if (m.get(curr_Row, i) != 0) { return(true); } } if (m.getBVector(curr_Row, 0) != 0) { return(false); } } return(true); }; if (canBeSolved(A)) { int[][] solution = new int[r][]; for (int i = 0; i < r; i++) { solution[i] = new int[c]; } for (int i = 0; i < ASize; i++) { solution[i / r][i % c] = A.getBVector(i, 0); } IList <Node> nodes = new List <Node>(); var last = new Node(new HashSet <Tuple <int, int> >()) { Board = Initial }; nodes.Add(last); for (int i = 0; i < r; i++) { for (int j = 0; j < c; j++) { if (solution[i][j] == 1) { var bb = last.Board.Clone() as Board; bb.Click(i, j); var node = new Node(null) { Board = bb }; nodes.Add(node); last = node; } } } return(nodes); } return(new List <Node>()); }
public static Elements.Inputs.Textbox Generate(Property property) { var textboxInstance = property.Element as Elements.Inputs.Textbox; textboxInstance.Value = property.PropertyValue; textboxInstance.Rendered = GenerateTextboxBody(textbox: textboxInstance) + Initial.RenderErrorElements(errorElements: property.ErrorElements); return(textboxInstance); }
public override int GetHashCode() => Initial.GetHashCode();
public Usuario() { this.Conn = new SqlConnection( "Data Server=localhost\SQLEXPRESS;Initial Catalog=tp2_net;Integrated Security=true;user=DESKTOP-F8EBEBO\tato9;password=2233;"); /* * Este connection string es para conectarse con la base de datos academia en el servidor * del departamento sistemas desde una PC de los laboratorios de sistemas, * si realiza este Laboratorio desde su PC puede probar el siguiente connection string * * "Data Source=localhost;Initial Catalog=academia;Integrated Security=true;" * * Si realiza esta práctica sobre el MS SQL SERVER 2005 Express Edition entonce debe * utilizar el siguiente connection string * * "Data Source=localhost\SQLEXPRESS;Initial Catalog=academia;Integrated Security=true;" */ this.daUsuarios = new SqlDataAdapter("select * from usuarios", this.Conn); this.daUsuarios.UpdateCommand = new SqlCommand(" UPDATE usuarios " + " SET tipo_doc = @tipo_doc, nro_doc = @nro_doc, fecha_nac = @fecha_nac, " + " apellido = @apellido, nombre = @nombre, direccion = @direccion, " + " telefono = @telefono, email = @email, celular = @celular, usuario = @usuario, " + " clave = @clave WHERE id=@id ", this.Conn); this.daUsuarios.UpdateCommand.Parameters.Add("@tipo_doc", SqlDbType.Int, 1, "tipo_doc"); this.daUsuarios.UpdateCommand.Parameters.Add("@nro_doc", SqlDbType.Int, 1, "nro_doc"); this.daUsuarios.UpdateCommand.Parameters.Add("@fecha_nac", SqlDbType.DateTime, 1, "fecha_nac"); this.daUsuarios.UpdateCommand.Parameters.Add("@apellido", SqlDbType.VarChar, 50, "apellido"); this.daUsuarios.UpdateCommand.Parameters.Add("@nombre", SqlDbType.VarChar, 50, "nombre"); this.daUsuarios.UpdateCommand.Parameters.Add("@direccion", SqlDbType.VarChar, 50, "direccion"); this.daUsuarios.UpdateCommand.Parameters.Add("@telefono", SqlDbType.VarChar, 50, "telefono"); this.daUsuarios.UpdateCommand.Parameters.Add("@email", SqlDbType.VarChar, 50, "email"); this.daUsuarios.UpdateCommand.Parameters.Add("@celular", SqlDbType.VarChar, 50, "celular"); this.daUsuarios.UpdateCommand.Parameters.Add("@usuario", SqlDbType.VarChar, 50, "usuario"); this.daUsuarios.UpdateCommand.Parameters.Add("@clave", SqlDbType.VarChar, 50, "clave"); this.daUsuarios.UpdateCommand.Parameters.Add("@id", SqlDbType.Int, 1, "id"); this.daUsuarios.InsertCommand = new SqlCommand(" INSERT INTO usuarios(tipo_doc,nro_doc,fecha_nac,apellido, " + " nombre,direccion,telefono,email,celular,usuario,clave) " + " VALUES (@tipo_doc,@nro_doc,@fecha_nac,@apellido,@nombre,@direccion, " + " @telefono,@email,@celular, @usuario, @clave )", this.Conn); this.daUsuarios.InsertCommand.Parameters.Add("@tipo_doc", SqlDbType.Int, 1, "tipo_doc"); this.daUsuarios.InsertCommand.Parameters.Add("@nro_doc", SqlDbType.Int, 1, "nro_doc"); this.daUsuarios.InsertCommand.Parameters.Add("@fecha_nac", SqlDbType.DateTime, 1, "fecha_nac"); this.daUsuarios.InsertCommand.Parameters.Add("@apellido", SqlDbType.VarChar, 50, "apellido"); this.daUsuarios.InsertCommand.Parameters.Add("@nombre", SqlDbType.VarChar, 50, "nombre"); this.daUsuarios.InsertCommand.Parameters.Add("@direccion", SqlDbType.VarChar, 50, "direccion"); this.daUsuarios.InsertCommand.Parameters.Add("@telefono", SqlDbType.VarChar, 50, "telefono"); this.daUsuarios.InsertCommand.Parameters.Add("@email", SqlDbType.VarChar, 50, "email"); this.daUsuarios.InsertCommand.Parameters.Add("@celular", SqlDbType.VarChar, 50, "celular"); this.daUsuarios.InsertCommand.Parameters.Add("@usuario", SqlDbType.VarChar, 50, "usuario"); this.daUsuarios.InsertCommand.Parameters.Add("@clave", SqlDbType.VarChar, 50, "clave"); this.daUsuarios.DeleteCommand = new SqlCommand(" DELETE FROM usuarios WHERE id=@id ", this.Conn); this.daUsuarios.DeleteCommand.Parameters.Add("@id", SqlDbType.Int, 1, "id"); }
public void StartWorld() { Input.SetMouseMode(Input.MouseMode.Visible); PackedScene main = (PackedScene)ResourceLoader.Load("res://Maps/lastresort_b5.tscn"); Spatial inst = (Spatial)main.Instance(); Initial of = GetNode("/root/Initial") as Initial; of.AddChild(inst); Spatial entitySpawns = GetNode("/root/Initial/Map/QodotMap/Entity Spawns") as Spatial; Godot.Collections.Array ents = entitySpawns.GetChildren(); foreach (Spatial ent in ents) { Godot.Collections.Dictionary fields = ent.Get("properties") as Godot.Collections.Dictionary; if (fields != null) { foreach (DictionaryEntry kvp in fields) { if (kvp.Key.ToString().ToLower().Contains("classname")) { switch (kvp.Value.ToString().ToLower()) { case "info_player_start": foreach (DictionaryEntry kvp2 in fields) { switch (kvp2.Key.ToString().ToLower()) { case "allowteams": string team = kvp2.Value.ToString().ToLower(); if (team.Contains("blue")) { spawnsTeam1.Add(ent); } if (team.Contains("red")) { spawnsTeam2.Add(ent); } break; } } break; } } } } } Spatial triggers = GetNode("/root/Initial/Map/QodotMap/Triggers") as Spatial; Godot.Collections.Array triggerents = triggers.GetChildren(); List <Trigger_Door> doors = new List <Trigger_Door>(); foreach (Area ent in triggerents) { Godot.Collections.Dictionary fields = ent.Get("properties") as Godot.Collections.Dictionary; foreach (DictionaryEntry kvp in fields) { if (kvp.Key.ToString().ToLower() == "classname") { if (kvp.Value.ToString().ToLower() == "trigger_door") { // https://github.com/godotengine/godot/issues/31994#issuecomment-570073343 ulong objId = Convert.ToUInt64(ent.GetInstanceId()); ent.SetScript(ResourceLoader.Load("Scripts/Trigger_Door.cs")); Trigger_Door newEnt = GD.InstanceFromId(objId) as Trigger_Door; newEnt.SetProcess(true); newEnt.Notification(NotificationReady); newEnt.Init(fields); doors.Add(newEnt); } } } } this.LinkDoors(doors); }
public override int GetHashCode() => Final.GetHashCode() ^ Initial.GetHashCode() ^ Currency.GetHashCode();
public void Connect() { string connectionString = "Data Source=DESKTOP-4OS0TGP\SQLEXPRESS;Initial Catalog=TunaGestDB;Integrated Security=True"; SqlConnection connection; connection = new SqlConnection(connectionString); connection.Open(); }
// Return the first state of the plan. public State GetFirstState() { return((State)Initial.Clone()); }
private void CheckMigrationHistoryTable(ExecutionContext executionContext) { var initialMigration = new Initial(); initialMigration.Commands.ForEach(i => i.Execute(executionContext)); }