但是那些都必須要再整理過,
因此先寫一篇無關痛癢的Filter吧~
Angular Js提供多種Filter可使用。
- Currency:用來將數字轉換成貨幣
- Date:轉換成特定日期格式
- Filter:篩選機制,有點像是AutoComplete
- Json:將物件轉換成Json字串。
- limitTo:限制輸出的長度
- lowercase、uppercase:轉換為大小寫
- number:轉換為數字格式,並決定小數點後位數。
- orderBy:排序,超強。
<!DOCTYPE html> <html ng-app> <head> <script src="http://code.angularjs.org/1.2.0/angular.min.js"></script> <meta charset="utf-8" /> <script type="text/javascript"> //Controller function urCtrl($scope){ $scope.urName="it was inited from controller"; } </script> </head> <body> <!-- Smapel ng-controller --> <div class="box" ng-controller="urCtrl"> Sample ng-controller----------------<br> Type in ur Name<input name="input" ng-model="urName"><br> Hi~ {{urName}}!!!! </div> </body> </html>
CREATE OR REPLACE FUNCTION CreatTeam(Num IN NUMBER) RETURN TEAMWITHPLAYER AS tempNum Number; BEGIN FOR i IN 1..Num loop SELECT ROUND(DBMS_RANDOM.VALUE(20,30))into tempNum FROM DUAL; --addPlayer(姓名、地址、年齡)都採Random輸出 AddPlayerToTeam.addPlayer('Name A'||i ,'Taipei No.'||i*10,tempNum); end loop; RETURN AddPlayerToTeam.getAll(); END;
CREATE OR REPLACE PACKAGE AddPlayerToTeam IS Procedure addPlayer( NameStr IN VARCHAR2 , AddrStr IN VARCHAR2 , AgeStr IN VARCHAR2 ); Function getAll Return TEAMWITHPLAYER; End AddPlayerToTeam; CREATE OR REPLACE PACKAGE BODY AddPlayerToTeam IS Procedure addPlayer( NameStr IN VARCHAR2 , AddrStr IN VARCHAR2 , AgeStr IN VARCHAR2 ) as language java name 'Kunde.Test.Java.AddPlayerToTeam.addString(java.lang.String,java.lang.String,java.lang.String)'; Function getAll Return TEAMWITHPLAYER as language java name 'Kunde.Test.Java.AddPlayerToTeam.getLog() return oracle.sql.ARRAY'; End AddPlayerToTeam;
import java.io.*; public class test { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub //Hello World!!!! System.out.println("Hello World!!!!!!!!!!!"); BufferedWriter out = new BufferedWriter(new FileWriter("D://output.txt")); try { String inputLine = "Hello World!!!!!!!!!!!"; out.write(inputLine); out.newLine(); } catch(IOException e1) { System.out.println("Error during reading/writing"); } finally { out.close(); } } }
class LeagueDto : IOracleCustomType { [OracleObjectMappingAttribute("NAME")] public virtual string Name { get; set; } [OracleObjectMappingAttribute("MEMBERS")] public virtual TeamWithPlayer Members { get; set; } public virtual void FromCustomObject(OracleConnection con, System.IntPtr pUdt) { OracleUdt.SetValue(con, pUdt, "NAME", this.Name); OracleUdt.SetValue(con, pUdt, "MEMBERS", this.Members); } public virtual void ToCustomObject(OracleConnection con, System.IntPtr pUdt) { this.Name = ((string)(OracleUdt.GetValue(con, pUdt, "NAME"))); this.Members = (TeamWithPlayer)OracleUdt.GetValue(con, pUdt, "MEMBERS"); } [OracleCustomTypeMapping("LEAGUE")] public class LeagueFactory : IOracleCustomTypeFactory { public virtual IOracleCustomType CreateObject() { return new LeagueDto(); } } }
class TeamWithPlayer : IOracleCustomType { //Dto是自己的DTO public PlayerDto[] Value; public virtual void FromCustomObject(OracleConnection con, System.IntPtr pUdt) { OracleUdt.SetValue(con, pUdt, 0, this.Value); } public virtual void ToCustomObject(OracleConnection con, System.IntPtr pUdt) { Value = (PlayerDto[])OracleUdt.GetValue(con, pUdt, 0); } [OracleCustomTypeMapping("TEAMWITHPLAYER")] public class TeamWithPlayerFactory : IOracleCustomTypeFactory, IOracleArrayTypeFactory { public virtual IOracleCustomType CreateObject() { return new TeamWithPlayer(); } public virtual Array CreateArray(int length) { return new PlayerDto[length]; } public virtual Array CreateStatusArray(int length) { return null; } } }--------DTO---------
class PlayerDto : IOracleCustomType { [OracleObjectMappingAttribute("NAME")] public virtual string Name { get; set; } [OracleObjectMappingAttribute("ADDRESS")] public virtual string Address { get; set; } [OracleObjectMappingAttribute("AGE")] public virtual decimal Age { get; set; } public virtual void FromCustomObject(OracleConnection objCon, IntPtr objUdt) { OracleUdt.SetValue(objCon, objUdt, "NAME", this.Name); OracleUdt.SetValue(objCon, objUdt, "ADDRESS", this.Address); OracleUdt.SetValue(objCon, objUdt, "AGE", this.Age); } public virtual void ToCustomObject(OracleConnection objCon, IntPtr objUdt) { this.Name = ((string)(OracleUdt.GetValue(objCon, objUdt, "NAME"))); this.Address = ((string)(OracleUdt.GetValue(objCon, objUdt, "ADDRESS"))); this.Age = ((decimal)(OracleUdt.GetValue(objCon, objUdt, "AGE"))); } [OracleCustomTypeMappingAttribute("PLAYER")] public class PlayerFactory : IOracleCustomTypeFactory { public virtual IOracleCustomType CreateObject() { PlayerDto obj = new PlayerDto(); return obj; } } }-------Main---------
static void Main(string[] args) { Console.WriteLine("Welcome to using C# Custom Object and Oracle User-defined Types:"); Console.WriteLine("Using DTO & UDTs with procedure to change the Player's age "); LeagueDto objLeague = new LeagueDto(); PlayerDto objPlayer = new PlayerDto(); objPlayer.Name = "Mr. Syscom"; objPlayer.Address = "台北市108萬華區峨眉街115號"; objPlayer.Age = 20; PlayerDto objPlayer2 = new PlayerDto(); objPlayer2.Name = "Mr. Syscom2"; objPlayer2.Address = "台北市108萬華區峨眉街115號"; objPlayer2.Age = 30; objLeague.Name = "Group 1"; objLeague.Members = new TeamWithPlayer(); objLeague.Members.Value = new PlayerDto[2] { objPlayer, objPlayer2 }; Console.WriteLine("Player1 Age was " + objLeague.Members.Value[0].Age); Console.WriteLine("Player2 Age was " + objLeague.Members.Value[1].Age); String ConnectionString = ConfigurationManager.ConnectionStrings["ABC"].ConnectionString; // Establish the connection with Oracle using (OracleConnection objCon = new OracleConnection(ConnectionString)) { // Open the connection objCon.Open(); // Insert the Person object into database table using (OracleCommand cmd = new OracleCommand("AlterLeague", objCon)) { cmd.CommandType = CommandType.StoredProcedure; //Database store procedure // Oracle Paramater OracleParameter objParam = new OracleParameter(); //Denotes, we are going to pass a custom object objParam.OracleDbType = OracleDbType.Object; objParam.Direction = ParameterDirection.InputOutput; // Note: The UdtTypeName is case-senstive - Should be in upper case objParam.UdtTypeName = "LEAGUE"; // Attach custom object as input parameter objParam.Value = objLeague; //Attach parameter to command object cmd.Parameters.Add(objParam); // Insert the UDT into the table cmd.ExecuteNonQuery(); objLeague = (LeagueDto)cmd.Parameters[0].Value; } } Console.WriteLine("After alter the age:"); Console.WriteLine("Player1 Age is " + objLeague.Members.Value[0].Age); Console.WriteLine("Player2 Age is " + objLeague.Members.Value[1].Age); Console.ReadLine(); }-----Procedure---------
CREATE OR REPLACE procedure EEP.AlterLeague(L_LEAGUE IN OUT LEAGUE) as begin L_LEAGUE.MEMBERS(1).age:=22; L_LEAGUE.MEMBERS(2).age:=32; end AlterLeague;Object with collection in Oracle
CREATE OR REPLACE TYPE EEP.LEAGUE AS OBJECT ( name varchar2(30), MEMBERS TEAMWITHPLAYER )NOT FINAL--------Collection in Oracle---------
CREATE OR REPLACE TYPE EEP.TEAMWITHPLAYER AS TABLE OF PLAYER----------Object---------
CREATE OR REPLACE TYPE EEP.PLAYER AS OBJECT ( name varchar2(30), address varchar2(60), age number(3) )NOT FINAL----------Result---------
class Program { static void Main(string[] args) { Console.WriteLine("了解Static Constructor 與Constructor"); ForTestConstractor x = new ForTestConstractor(); Console.ReadLine(); } } class ForTestConstractor { //static Constrator static ForTestConstractor() { Console.WriteLine("static Constructor"); } public ForTestConstractor() { Console.WriteLine("normal Constructor"); } }執行結果:
@using (Ajax.BeginForm("Create", "DIM", new AjaxOptions { HttpMethod = "POST", Confirm = "確定要變更?", UpdateTargetId = "ajaxBody" })) { @Html.EditorFor(model => model.id)--Controller------------------------------------------------------------------------------------------------}
[HttpPost] public ActionResult Create(ModelDto XDto, string btn) { if (ModelState.IsValid) { if (btn == "Create") { db.ModelDto .Add(XDto); db.SaveChanges(); } else { db.Entry(XDto).State = EntityState.Modified; db.SaveChanges(); } } return RedirectToAction("List"); }
PROCEDURE ASSERT (description IN VARCHAR2 , expected_value IN VARCHAR2, actual_value IN VARCHAR2) --驗證用 IS BEGIN DBMS_OUTPUT.PUT(description || ': '); IF expected_value = actual_value OR (expected_value IS NULL AND actual_value IS NULL) THEN DBMS_OUTPUT.PUT_LINE('PASSED'); ELSE DBMS_OUTPUT.PUT_LINE('FAILED. Expected ' || expected_value || '; got ' || actual_value); END IF; END; PROCEDURE ASSERT (description IN VARCHAR2 , expected_value IN NUMBER, actual_value IN NUMBER) --驗證用 IS BEGIN DBMS_OUTPUT.PUT(description || ': '); IF expected_value = actual_value OR (expected_value IS NULL AND actual_value IS NULL) THEN DBMS_OUTPUT.PUT_LINE('PASSED'); ELSE DBMS_OUTPUT.PUT_LINE('FAILED. Expected ' || expected_value || '; got ' || actual_value); END IF; END;-------------------------------
Declare A number;--預計資料筆數 B number;--實際資料筆數(從table撈) PROCEDURE ASSERT (description IN VARCHAR2 , expected_value IN VARCHAR2, actual_value IN VARCHAR2) --驗證用 IS BEGIN DBMS_OUTPUT.PUT(description || ': '); IF expected_value = actual_value OR (expected_value IS NULL AND actual_value IS NULL) THEN DBMS_OUTPUT.PUT_LINE('PASSED'); ELSE DBMS_OUTPUT.PUT_LINE('FAILED. Expected ' || expected_value || '; got ' || actual_value); END IF; END; PROCEDURE ASSERT (description IN VARCHAR2 , expected_value IN NUMBER, actual_value IN NUMBER) --驗證用 IS BEGIN DBMS_OUTPUT.PUT(description || ': '); IF expected_value = actual_value OR (expected_value IS NULL AND actual_value IS NULL) THEN DBMS_OUTPUT.PUT_LINE('PASSED'); ELSE DBMS_OUTPUT.PUT_LINE('FAILED. Expected ' || expected_value || '; got ' || actual_value); END IF; END; BEGIN A : =10;(預計10筆) SELECT Count(*) INTO B FROM table; ASSERT('筆數檢核:',A,B) ; END;------------------------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE EEP.ERRORTEST AS PROCEDURE proc1; PROCEDURE proc2; PROCEDURE proc3; END;
class SimpleTable : IOracleCustomType { [OracleArrayMapping()] //Dto是自己的DTO public Dto[] Value; public virtual void FromCustomObject(OracleConnection con, System.IntPtr pUdt) { OracleUdt.SetValue(con, pUdt, 0, this.Value); } public virtual void ToCustomObject(OracleConnection con, System.IntPtr pUdt) { Value = (Dto[])OracleUdt.GetValue(con, pUdt, 0); //this.Value = ((Dto[])(OracleUdt.GetValue(con, pUdt, 0))); } [OracleCustomTypeMapping("TESTTABLE")] public class SimpleTableFactory : IOracleCustomTypeFactory, IOracleArrayTypeFactory { public virtual IOracleCustomType CreateObject() { return new SimpleTable(); } public virtual Array CreateArray(int length) { return new Dto[length]; } public virtual Array CreateStatusArray(int length) { return null; } } }
public class SimpleVarray : IOracleCustomType, INullable { [OracleArrayMapping()] public string[] Array; private bool m_bIsNull; public bool IsNull { get { return m_bIsNull; } } public static SimpleVarray Null { get { SimpleVarray obj = new SimpleVarray(); obj.m_bIsNull = true; return obj; } } public void ToCustomObject(OracleConnection con, IntPtr pUdt) { object objectStatusArray = null; Array = (string[])OracleUdt.GetValue(con, pUdt, 0, out objectStatusArray); } public void FromCustomObject(OracleConnection con, IntPtr pUdt) { OracleUdt.SetValue(con, pUdt, 0, Array); } } [OracleCustomTypeMapping("EEP.TESTVARRAY")] public class SimpleVarrayFactory : IOracleCustomTypeFactory, IOracleArrayTypeFactory { public IOracleCustomType CreateObject() { return new SimpleVarray(); } public Array CreateArray(int numElems) { return new string[numElems]; } public Array CreateStatusArray(int numElems) { return null; } }C#----main
private static void OrderReport() { SimpleVarray test = new SimpleVarray(); test.Array = new string[] { "A","B","C","D", "E","F","G","H",DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") }; String ConnectionString = ConfigurationManager.ConnectionStrings["ABC"].ConnectionString; using (OracleConnection conn = new OracleConnection(ConnectionString)) { conn.Open(); using (OracleCommand cmd = conn.CreateCommand()) { try { cmd.CommandText = "TEST"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("V_List", OracleDbType.Array).Direction = ParameterDirection.Input; cmd.Parameters[0].Value = test; cmd.Parameters[0].UdtTypeName = "TESTVARRAY"; cmd.ExecuteNonQuery(); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.WriteLine("1"); Console.ReadLine(); } } }ORACLE TYPE---
TYPE "TESTVARRAY" AS VARRAY(3000) OF VARCHAR(30)
PROCEDURE TEST(V_List IN TESTVARRAY) AS BEGIN INSERT INTO AAAA (A, B,C, D, E, F, G, H, DATETIME) VALUES(V_List(1), V_List(2), V_List(3), V_List(4), V_List(5), V_List(6), V_List(7), V_List(8), to_timestamp(V_List(9), 'yyyy-mm-dd hh24:mi:ss.ff3')); END;
class PersonDto : IOracleCustomType { [OracleObjectMappingAttribute("PNAME")] public virtual string Name { get; set; } [OracleObjectMappingAttribute("ADDRESS")] public virtual string Address { get; set; } [OracleObjectMappingAttribute("AGE")] public virtual decimal Age { get; set; } public virtual void FromCustomObject(OracleConnection objCon, IntPtr objUdt) { OracleUdt.SetValue(objCon, objUdt, "PNAME", this.Name); OracleUdt.SetValue(objCon, objUdt, "ADDRESS", this.Address); if (this.Age > 0) OracleUdt.SetValue(objCon, objUdt, "AGE", this.Age); } public virtual void ToCustomObject(OracleConnection objCon, IntPtr objUdt) { this.Name = ((string)(OracleUdt.GetValue(objCon, objUdt, "PNAME"))); this.Address = ((string)(OracleUdt.GetValue(objCon, objUdt, "ADDRESS"))); bool AgeIsNull = OracleUdt.IsDBNull(objCon, objUdt, "AGE"); if ((AgeIsNull == false)) this.Age = ((decimal)(OracleUdt.GetValue(objCon, objUdt, "AGE"))); } [OracleCustomTypeMappingAttribute("PERSON")] public class PersonFactory : IOracleCustomTypeFactory { public virtual IOracleCustomType CreateObject() { PersonDto obj = new PersonDto(); return obj; } } }
Load Average Begin | Load Average End | %User | %System | %WIO | %Idle |
---|---|---|---|---|---|
4.9 | 4.0 | 91.2 |
Statistic | Value | End Value |
---|---|---|
AVG_BUSY_TIME | 8,372 | |
AVG_IDLE_TIME | 86,474 | |
AVG_SYS_TIME | 3,761 | |
AVG_USER_TIME | 4,590 | |
BUSY_TIME | 33,590 | |
IDLE_TIME | 345,995 | |
SYS_TIME | 15,133 | |
USER_TIME | 18,457 | |
RSRC_MGR_CPU_WAIT_TIME | 0 | |
VM_IN_BYTES | 66,340,137,790,754,816 | |
VM_OUT_BYTES | -144,554,992,965,316,608 | |
PHYSICAL_MEMORY_BYTES | 8,470,183,936 | |
NUM_CPUS | 4 | |
NUM_CPU_CORES | 2 | |
NUM_CPU_SOCKETS | 1 |
1) background elapsed time 2) background cpu time 3) RMAN cpu time (backup/restore) 1) DB time 2) DB CPU 2) connection management call elapsed time 2) sequence load elapsed time 2) sql execute elapsed time 2) parse time elapsed 3) hard parse elapsed time 4) hard parse (sharing criteria) elapsed time 5) hard parse (bind mismatch) elapsed time 3) failed parse elapsed time 4) failed parse (out of shared memory) elapsed time 2) PL/SQL execution elapsed time 2) inbound PL/SQL rpc elapsed time 2) PL/SQL compilation elapsed time 2) Java execution elapsed time 2) repeated bind elapsed time
Filter value | Memory regions displayed |
---|---|
VAR | Busy regions. These regions include all virtual allocation blocks, the SBH heap, memory from custom allocators, and all other regions of the address space that fall into no other classification. |
Free | Free memory. This includes all memory that has not been reserved. |
Image | Memory that is mapped to a file that is part of an executable image. |
Stack | Memory used for thread stacks. |
Teb | Memory used for thread environment blocks (TEBs). |
Peb | Memory used for the process environment block (PEB). |
Heap | Memory used for heaps. |
PageHeap | The memory region used for the full-page heap. |
CSR | CSR shared memory. |
Actx | Memory used for activation context data. |
NLS | Memory used for National Language Support (NLS) tables. |
FileMap | Memory used for memory-mapped files. This filter is applicable only during live debugging. |
0:000> !help DumpHeap ------------------------------------------------------------------------------- !DumpHeap [-stat] [-strings] [-short] [-min <size>] [-max <size>] [-thinlock] [-startAtLowerBound] [-mt <MethodTable address>] [-type <partial type name>] [start [end]] !DumpHeap is a powerful command that traverses the garbage collected heap, collection statistics about objects. With it's various options, it can look for particular types, restrict to a range, or look for ThinLocks (see !SyncBlk documentation). Finally, it will provide a warning if it detects excessive fragmentation in the GC heap.