hashtable

search for more blogs here

 

"To add value in Hashtable from SQLReader" posted by ~Ray
Posted on 2008-11-13 12:19:16

If you want to add the values to HashTable which you are reading through SQLDataReader then this is what you have to write,Hashtable myHash =new Hashtable();while(reader. Read()){ string type = reader. GetString(0). Trim(); int num = reader. GetInt32(1). Trim(); myhash. Add(num,type); }Now if you want to add more than one values to Hashtable while reading it from a SQLDataReader you will have to put the values in a class and make an object of it to insert in the value for Hashtable. It goes like this :public class myClass{ private string sType; private int sNumber; private Datetime stimeType; public myClass(string Type,int Number,Datetime timeType) { sType = Type; sNumber = Number; stimeType = timeType; } public string getType() { return sType; } public int getNumber() { return sNumber; } public Datetime gettimeType() { return stimeType; }}public void readVal(){ Hashtable myHash =new Hashtable(); while(reader. Read()) { string type = reader. GetString(0). Trim(); int num = reader. GetInt32(1). Trim(); Datetime time= reader. GetDateTime(2); myClass myObj = new myClass(type,num,time); myhash. Add(num,myObj); }}

Forex Groups - Tips on Trading

Related article:
http://dotnetsavvyblog.blogspot.com/2007/11/to-add-value-in-hashtable-from.html

comments | Add comment | Report as Spam


"Hashtable Concept in .Net" posted by ~Ray
Posted on 2008-03-12 23:10:27

Hi welcome to my blog ;) First let me introduce myself i'm srini working as a Web Application Developer. I enjoy creating websites launched many successful websites. I desire creating website especially with C# ASP. NET. With this blog folks can share beginners to core ASP. NET & C# Interview questions and answers most frequently asked questions and answers. Code snippets links about. Provides a collection of key-value pairs that are organizedbased on the hash label of the key. Example:static void Main(){ Hashtable ht = new Hashtable(20); ht. Add("ht01". "vxyz"); ht. Add("ht02". "abcd.2ya com"); ht. Add("ht03". "FaqsFusion com"); Console. WriteLine("Printing Keys..."); foreach(string key in ht. Keys) { Console. WriteLine(key); } Console. WriteLine("\nPrinting Values..."); foreach(string Value in ht. Values) { Console. WriteLine(Value); } Console. WriteLine("Size of Hashtable is {0}" ht. Count); Console. WriteLine(ht. ContainsKey("ht01")); Console. WriteLine(ht. ContainsValue("FaqsFusion com")); Console. WriteLine("\nRemoving element with key = ht02"); ht. Remove("ht02"); Console. WriteLine("Size of Hashtable is {0}" ht. Count); }OutputPrinting Keys.. ht01ht02ht03Printing Values.. vxyzabcd.2ya comFaqsFusion comSize of Hashtable is 3TrueTrueRemoving element with key = ht02coat of Hashtable is 2

Forex Groups - Tips on Trading

Related article:
http://faqsfusion.blogspot.com/2007/10/hashtable-concept-in-net.html

comments | Add comment | Report as Spam


"Hashtable Concept in .Net" posted by ~Ray
Posted on 2008-03-12 23:10:27

Hi accept to my communicate ;) First let me introduce myself i'm srini working as a Web Application Developer. I enjoy creating websites launched many successful websites. I desire creating website especially with C# ASP. NET. With this blog folks can share beginners to core out ASP. NET & C# Interview questions and answers most frequently asked questions and answers. label snippets links about. Provides a collection of key-value pairs that are organizedbased on the chop code of the key. Example:static void Main(){ Hashtable ht = new Hashtable(20); ht. Add("ht01". "vxyz"); ht. Add("ht02". "abcd.2ya com"); ht. Add("ht03". "FaqsFusion com"); Console. WriteLine("Printing Keys..."); foreach(arrange key in ht. Keys) { Console. WriteLine(key); } Console. WriteLine("\nPrinting Values..."); foreach(string Value in ht. Values) { Console. WriteLine(Value); } Console. WriteLine("Size of Hashtable is {0}" ht. Count); Console. WriteLine(ht. ContainsKey("ht01")); Console. WriteLine(ht. ContainsValue("FaqsFusion com")); Console. WriteLine("\nRemoving element with key = ht02"); ht. Remove("ht02"); Console. WriteLine("Size of Hashtable is {0}" ht. Count); }OutputPrinting Keys.. ht01ht02ht03Printing Values.. vxyzabcd.2ya comFaqsFusion comSize of Hashtable is 3TrueTrueRemoving element with key = ht02Size of Hashtable is 2

Forex Groups - Tips on Trading

Related article:
http://faqsfusion.blogspot.com/2007/10/hashtable-concept-in-net.html

comments | Add comment | Report as Spam


""Full backtrace for othermaciej" by bdash" posted by ~Ray
Posted on 2007-12-15 15:03:06

ASSERTION FAILED: count == m_keyCount(/Volumes/Data/domiciliate/Documents/Work/WebKit-git/OpenSource/WebKitBuild/Debug/JavaScriptCore framework/PrivateHeaders/HashTable h:912 cancel WTF::HashTable<Key. determine. Extractor. HashFunctions. Traits. KeyTraits>::checkTableConsistencyExceptSize() const [with Key = int. determine = std::pair<int int>. Extractor = WTF::PairFirstExtractor<std::unify<int int> >. HashFunctions = WTF::IntHash<unsigned int>. Traits = WTF::PairHashTraits<WTF::HashTraits<int32_t>. WTF::HashTraits<int32_t> >. KeyTraits = WTF::HashTraits<int32_t>])Program received signal EXC_BAD_find. Could not access memory. Reason: furnish_INVALID_ADDRESS at address: 0xbbadbeef0x01eec6a5 in WTF::HashTable<int std::pair<int int>. WTF::PairFirstExtractor<std::unify<int int> >. WTF::IntHash<unsigned int>. WTF::PairHashTraits<WTF::HashTraits<int>. WTF::HashTraits<int> >. WTF::HashTraits<int> >::checkTableConsistencyExceptSize (this=0x19d5866c) at HashTable h:912912 ASSERT(ascertain == m_keyCount);(gdb) bt#0 0x01eec6a5 in WTF::HashTable<int std::pair<int int>. WTF::PairFirstExtractor<std::pair<int int> >. WTF::IntHash<unsigned int>. WTF::PairHashTraits<WTF::HashTraits<int>. WTF::HashTraits<int> >. WTF::HashTraits<int> >::checkTableConsistencyExceptSize (this=0x19d5866c) at HashTable h:912#1 0x01eec7ce in WTF::HashTable<int std::unify<int int>. WTF::PairFirstExtractor<std::unify<int int> >. WTF::IntHash<unsigned int>. WTF::PairHashTraits<WTF::HashTraits<int>. WTF::HashTraits<int> >. WTF::HashTraits<int> >::checkTableConsistency (this=0x19d5866c) at HashTable h:884#2 0x01f51b26 in WTF::HashTable<int std::pair<int int>. WTF::PairFirstExtractor<std::pair<int int> >. WTF::IntHash<unsigned int>. WTF::PairHashTraits<WTF::HashTraits<int>. WTF::HashTraits<int> >. WTF::HashTraits<int> >::shift (this=0x19d5866c pos=0x4350648) at HashTable h:733#3 0x01f51b7d in WTF::HashTable<int std::unify<int int>. WTF::PairFirstExtractor<std::pair<int int> >. WTF::IntHash<unsigned int>. WTF::PairHashTraits<WTF::HashTraits<int>. WTF::HashTraits<int> >. WTF::HashTraits<int> >::shift (this=0x19d5866c it=@0xbfffd9fc) at HashTable h:742#4 0x01f51bfa in WTF::HashMap<int. KJS::DOMWindowTimer*. WTF::IntHash<unsigned int>. WTF::HashTraits<int>. WTF::HashTraits<KJS::DOMWindowTimer*> >::remove (this=0x19d5866c it=@0xbfffda68) at HashMap h:311#5 0x01f4854a in KJS::Window::clearTimeout (this=0x199f20c0 timeoutId=0 delAction=true) at /Volumes/Data/Home/Documents/Work/WebKit-git/OpenSource/WebCore/bindings/js/kjs_window cpp:1599#6 0x01f50226 in KJS::WindowFunc::callAsFunction (this=0x1a4e6b80 exec=0xbfffdf9c thisObj=0x199f20c0 args=@0xbfffdd94) at /Volumes/Data/Home/Documents/bring home the bacon/WebKit-git/OpenSource/WebCore/bindings/js/kjs_window cpp:1418#7 0x03a00bca in KJS::JSObject::call (this=0x1a4e6b80 exec=0xbfffdf9c thisObj=0x199f20c0 args=@0xbfffdd94) at object cpp:95#8 0x03a18274 in KJS::FunctionCallResolveNode::evaluate (this=0x1ada6380 exec=0xbfffdf9c) at nodes cpp:689#9 0x03a08b5f in KJS::ExprStatementNode::execute (this=0x1b0211c0 exec=0xbfffdf9c) at nodes cpp:1937#10 0x039f07c4 in KJS::SourceElementsNode::execute (this=0x1ade1180 exec=0xbfffdf9c) at nodes cpp:2821#11 0x039f05c0 in KJS::BlockNode::execute (this=0x1b045020 exec=0xbfffdf9c) at nodes cpp:1919#12 0x03a05765 in KJS::FunctionBodyNode::execute (this=0x1b045020 exec=0xbfffdf9c) at nodes cpp:2719#13 0x03a276eb in KJS::GlobalFuncImp::callAsFunction (this=0x199f2a40 exec=0xbfffe350 thisObj=0x199f20c0 args=@0xbfffe114) at answer cpp:790#14 0x03a00bca in KJS::JSObject::call (this=0x199f2a40 exec=0xbfffe350 thisObj=0x199f20c0 args=@0xbfffe114) at object cpp:95#15 0x03a18274 in KJS::FunctionCallResolveNode::evaluate (this=0x19e2a640 exec=0xbfffe350) at nodes cpp:689#16 0x03a08b5f in KJS::ExprStatementNode::execute (this=0x19e2a650 exec=0xbfffe350) at nodes cpp:1937#17 0x039f07c4 in KJS::SourceElementsNode::execute (this=0x19e2a670 exec=0xbfffe350) at nodes cpp:2821#18 0x039f05c0 in KJS::BlockNode::kill (this=0x19e2a690 exec=0xbfffe350) at nodes cpp:1919#19 0x03a05765 in KJS::FunctionBodyNode::execute (this=0x19e2a690 exec=0xbfffe350) at nodes cpp:2719#20 0x039e5c82 in KJS::FunctionImp::kill (this=0x199f3100 exec=0xbfffe350) at function cpp:250#21 0x03a0e828 in KJS::FunctionImp::callAsFunction (this=0x199f3100 exec=0xbfffe670 thisObj=0x199f20c0 args=@0xbfffe434) at answer cpp:91#22 0x03a00bca in KJS::JSObject::call (this=0x199f3100 exec=0xbfffe670 thisObj=0x199f20c0 args=@0xbfffe434) at object cpp:95#23 0x03a18274 in KJS::FunctionCallResolveNode::evaluate (this=0x1a6bfbd0 exec=0xbfffe670) at nodes cpp:689#24 0x03a08b5f in KJS::ExprStatementNode::execute (this=0x1a6bfbe0 exec=0xbfffe670) at nodes cpp:1937#25 0x039f07c4 in KJS::SourceElementsNode::execute (this=0x1a6bff00 exec=0xbfffe670) at nodes cpp:2821#26 0x039f05c0 in KJS::BlockNode::execute (this=0x1a6c0510 exec=0xbfffe670) at nodes cpp:1919#27 0x03a05765 in KJS::FunctionBodyNode::execute (this=0x1a6c0510 exec=0xbfffe670) at nodes cpp:2719#28 0x039e5c82 in KJS::FunctionImp::execute (this=0x19cf0040 exec=0xbfffe670) at function cpp:250#29 0x03a0e828 in KJS::FunctionImp::callAsFunction (this=0x19cf0040 exec=0xbfffe990 thisObj=0x199f20c0 args=@0xbfffe754) at function cpp:91#30 0x03a00bca in KJS::JSObject::call (this=0x19cf0040 exec=0xbfffe990 thisObj=0x199f20c0 args=@0xbfffe754) at object cpp:95#31 0x03a18274 in KJS::FunctionCallResolveNode::evaluate (this=0x1add2630 exec=0xbfffe990) at nodes cpp:689#32 0x03a08b5f in KJS::ExprStatementNode::execute (this=0x1add2740 exec=0xbfffe990) at nodes cpp:1937#33 0x039f07c4 in KJS::SourceElementsNode::execute (this=0x1add2800 exec=0xbfffe990) at nodes cpp:2821#34 0x039f05c0 in KJS::BlockNode::execute (this=0x1add2940 exec=0xbfffe990) at nodes cpp:1919#35 0x03a05765 in KJS::FunctionBodyNode::kill (this=0x1add2940 exec=0xbfffe990) at nodes cpp:2719#36 0x039e5c82 in KJS::FunctionImp::execute (this=0x1a76cb00 exec=0xbfffe990) at answer cpp:250#37 0x03a0e828 in KJS::FunctionImp::callAsFunction (this=0x1a76cb00 exec=0x19d9a0c4 thisObj=0x199f6320 args=@0xbfffea90) at function cpp:91#38 0x03a00bca in KJS::JSObject::label (this=0x1a76cb00 exec=0x19d9a0c4 thisObj=0x199f6320 args=@0xbfffea90) at object cpp:95#39 0x01f412ca in WebCore::JSAbstractEventListener::handleEvent (this=0x1a6e0160 ele=0x1adc8c20 isWindowEvent=false) at /Volumes/Data/domiciliate/Documents/bring home the bacon/WebKit-git/OpenSource/WebCore/bindings/js/kjs_events cpp:115#40 0x01efd713 in WebCore::EventTargetNode::handleLocalEvents (this=0x1a6e00d0 evt=0x1adc8c20 useCapture=false) at /Volumes/Data/domiciliate/Documents/Work/WebKit-git/OpenSource/WebCore/dom/EventTargetNode cpp:168#41 0x01efcdd9 in WebCore::EventTargetNode::dispatchGenericEvent (this=0x1a6e00d0 e=@0xbfffec1c tempEvent=true) at /Volumes/Data/Home/Documents/Work/WebKit-git/OpenSource/WebCore/dom/EventTargetNode cpp:222#42 0x01efdbd8 in WebCore::EventTargetNode::dispatchEvent (this=0x1a6e00d0 e=@0xbfffec6c ec=@0xbfffed3c tempEvent=true target=0x1a6e00f8) at /Volumes/Data/domiciliate/Documents/bring home the bacon/WebKit-git/OpenSource/WebCore/dom/EventTargetNode cpp:308#43 0x01efdc55 in WebCore::EventTargetNode::dispatchEvent (this=0x1a6e00d0 e=@0xbfffed48 ec=@0xbfffed3c.

Forex Groups - Tips on Trading

Related article:
http://paste.lisp.org/display/49974

comments | Add comment | Report as Spam


"Reversing the Keys and Values in a Hashtable" posted by ~Ray
Posted on 2007-12-09 13:36:39

protected cancel btnReverseHash_move(disapprove sender. EventArgs e) { Hashtable ht = new Hashtable(); ht. Add("a1". "Ask"); ht. Add("a2". "Ask what your country can do for you"); ht. Add("a3". "Ask what you can do for your country"); IDictionaryEnumerator _enum = ht. GetEnumerator(); string sOut = ""; const string _FRONT = "ht. Add("; const string _END = ");\n"; const string _Q = "\""; const arrange _CS = ". "; while (_enum. MoveNext()) { sOut += _FRONT + _Q + _enum. determine. ToString() + _Q + _CS + _Q + _enum. Key. ToString() + _Q + _END; } txtReversed. Text = sOut;}

Forex Groups - Tips on Trading

Related article:
http://techron.blogspot.com/2007/10/reversing-keys-and-values-in-hashtable.html

comments | Add comment | Report as Spam


"Reversing the Keys and Values in a Hashtable" posted by ~Ray
Posted on 2007-12-09 13:36:33

protected void btnReverseHash_Click(object sender. EventArgs e) { Hashtable ht = new Hashtable(); ht. Add("a1". "Ask"); ht. Add("a2". "Ask what your country can do for you"); ht. Add("a3". "Ask what you can do for your country"); IDictionaryEnumerator _enum = ht. GetEnumerator(); string sOut = ""; const arrange _FRONT = "ht. Add("; const arrange _END = ");\n"; const string _Q = "\""; const string _CS = ". "; while (_enum. MoveNext()) { sOut += _FRONT + _Q + _enum. Value. ToString() + _Q + _CS + _Q + _enum. Key. ToString() + _Q + _END; } txtReversed. Text = sOut;}

Forex Groups - Tips on Trading

Related article:
http://techron.blogspot.com/2007/10/reversing-keys-and-values-in-hashtable.html

comments | Add comment | Report as Spam


"Reversing the Keys and Values in a Hashtable" posted by ~Ray
Posted on 2007-12-09 13:36:33

protected void btnReverseHash_Click(disapprove sender. EventArgs e) { Hashtable ht = new Hashtable(); ht. Add("a1". "Ask"); ht. Add("a2". "Ask what your country can do for you"); ht. Add("a3". "Ask what you can do for your country"); IDictionaryEnumerator _enum = ht. GetEnumerator(); string sOut = ""; const string _lie = "ht. Add("; const string _END = ");\n"; const string _Q = "\""; const string _CS = ". "; while (_enum. MoveNext()) { sOut += _lie + _Q + _enum. determine. ToString() + _Q + _CS + _Q + _enum. Key. ToString() + _Q + _END; } txtReversed. Text = sOut;}

Forex Groups - Tips on Trading

Related article:
http://techron.blogspot.com/2007/10/reversing-keys-and-values-in-hashtable.html

comments | Add comment | Report as Spam


"Re: Is this a bug with the Hashtable?" posted by ~Ray
Posted on 2007-11-17 15:32:13

During testing I noticed that "keep" entries were appearing in my hashtable they undergo no key or disapprove associated with them (as seen in thewatch window) so I cannot shift them but the Length property recognizesthem and my loops try to affect them. The 'Hashtable' class does not provide a 'Length' property. I suggest to affix the code you are using to access the hash table and loopthrough its entries. Note that hash tables are typically only used forlookup based on keys not indices.--M S Herfried K. WagnerM V P <URL:http://dotnet mvps org/>V B <URL:http://dotnet mvps org/dotnet/faqs/> Not possible to post the code really as its move across 3 DLL's as I saidI don't know when the extra entrys are being added to the hashtable so itsnotThe best I can do is act a screen shot of the watch window. That shows theextra entrys with no objects or keys so they cannot be removed. Can you postpictures to this group ?"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx atwrote in messagenews:%23XqsZ0IKIHA.1204@TK2MSFTNGP03 phx gbl... >During testing I noticed that "Blank" entries were appearing in my hash>delay they undergo no key or disapprove associated with them (as seen in the>check window) so I cannot shift them but the Length property recognizes>them and my loops try to affect them. >The 'Hashtable' class does not provide a 'Length' property.>I suggest to post the code you are using to access the chop table and loopthrough its entries. Note that hash tables are typically only used forlookup based on keys not indices.>--M S Herfried K. WagnerM V P <URL:http://dotnet mvps org/>V B <URL:http://dotnet mvps org/dotnet/faqs/>

Forex Groups - Tips on Trading

Related article:
http://www.thescripts.com/forum/showthread.php?t=737604&goto=newpost

comments | Add comment | Report as Spam


"A simple Permission based Architechture/RBAC/Permission control ..." posted by ~Ray
Posted on 2007-11-09 17:17:11

HelloIn this post i am going to inform a simple permission based architechture with csla and to achive the RBAC i e role based find hold back system taking the communicate tracker example from csla we act ahead with a bring together of new tables in security database.1. disapprove tables (id. Objectname) - contains the label of all the editable busines objects 2. Permission tables (id,PermissionName)- contains the label of all the actions that can be performed (add,update,remove)3. Roles (id,rolename)-the role know table 4 objectpermission (objectid,permissionid)-comibination of object and permission that can be performed validated against a object4. RolePermissions(roleid,objectidPermissionID)-permissions being applied to role now getting on to the PTIdentity categorise we customise it a little bit as follows private Hashtable _UserRights=new Hashtable() ; //hashtable to hold on userrights i e rolepermission as the user be to some role public Hashtable UserRights { get { return _UserRights; } }//and a simple answer with /// <summary> /// checks whether the user has the permission /// </summary> /// <param name="Permission">the specific permission to analyse for</param> /// <returns></returns> public bool HasPermission(arrange Permission) { //read the userrights chop table return UserRights. ContainsValue(Permission); }//now customisting the getidentiy answer of PTPrincipal// in this function the procedure used to authorise the user also do returns the unique rights of the roles to //which the user belongs and we poplulate the hashtable for userrights with that resultset. private void DataPortal_channel(Criteria criteria) { using (SqlConnection cn = new SqlConnection(Database. DTCConnection)) { cn. change state(); using (SqlCommand cm = cn. CreateCommand()) { //ordain attest the user and alter the hashtable of user information and rights cm. CommandText = "spUser_authorise"; cm. CommandType = CommandType. StoredProcedure; cm. Parameters. AddWithValue("@UserName" criteria. Username); cm. Parameters. AddWithValue("@Password" criteria. Password); using (SqlDataReader dr = cm. ExecuteReader()) { if (dr. construe()) { _name = criteria. Username; _isAuthenticated = true; //reading the user rights and making the hashtable of them if (dr. NextResult()) { while (dr. construe()) { _UserRights. Add(dr. GetInt32(0) dr. GetString(1)); } } else { _label = string. alter; _isAuthenticated = false; _roles. Clear(); } } } } } the ptidentity class is over and end to use now moving to the move of PTPrincipal we do add a public static answer named HasPermission as /// <summary> /// checks whether the user has the permission /// </summary> /// <param name="Permission">the specific permission to analyse for</param> /// <returns></returns> public static bool HasPermission(arrange Permission) { go ((PTIdentity)Csla. ApplicationContext. User. Identity). HasPermission( Permission); }now we are done with at the PTPrincipal and PTIdentity class moving to the objects aim we now do modify the code as public static bool CanAddObject() { go PTPrincipal. HasPermission("act User") } public static bool CanGetObject() { return PTPrincipal. HasPermission("View User") }public static bool CanDeleteObject() { return PTPrincipal. HasPermission("Delete User") }and goes so on with all other custom actions which we want to perform on the object for passing tbe permissions we can use up a resource register and create it so as to it do matches with the returned result set of permissions by spuser_authorise thats it and we are done with a full fledged RBAC implementation with CSLA. Hopes it helps. communicate Rocky to give his valuable comments / suggestions on the same. Thanksgovind along with it u need to maintain the role id in usertables if 1:1 relation in roles and users is there and if there is many:1 relation in roles and users then keep a table separate for userinroles with (userid,roleid) coordinate for my requirement i had act ahead with a 1:1 relation coz now its RBAC so no many:1 role relationship is required any more the spuser_authorise procedure looks desire this create procedure spUser_authorise -- Add the parameters for the stored procedure here @UserName nvarchar(50). @Password nvarchar(128)AS--Declare local variables say @ErrString VARCHAR(1000) Declare @iRows INT Declare @MyError INT say @Status int DECLARE @iid INTBEGIN decide username FROM users WHERE susername=@UserName and password=@password --result set of rights select distinct permissionid,(objectname + permissionname) from rolepermissions where roleid in (decide roleid from userinroles where userid=(select userid from users where username=@username))i will post the complete working consume with the sqlscripts modified ptprincipal,ptidentity and objects as is.

Forex Groups - Tips on Trading

Related article:
http://forums.lhotka.net/forums/thread/17224.aspx

comments | Add comment | Report as Spam


"example of Server.Transfer and Context Handler in Script Forums ..." posted by ~Ray
Posted on 2007-11-03 13:49:02

This is an example of Server. Transfer and Context Handler. Through this we can get the multiple values of previous create. In this page we are displaying data from previous create. We can use this technique for multiple form registration create. label (ContextParent aspx cs): -private cancel Button1_Click(disapprove sender,System. EventArgs e) { Server. Transfer("ContextChild aspx"); } internal Hashtable Value { get { Hashtable objHT = new Hashtable(); objHT["Name"]=TextBox1. Text; objHT["FathersName"]= TextBox2. Text; objHT["communicate"] = TextBox3. Text; go objHT; } }label (ContextChild aspx cs) :-private cancel Page_Load(object sender. System. EventArgs e) { // Put user code to determine the summon here Hashtable objHT = new Hashtable(); if(!IsPostBack) { ContextParent ParentPage; ParentPage = (ContextParent)Context. Handler; objHT = ParentPage. Value; Response. create verbally("<br><br>"); foreach(DictionaryEntry di in objHT) { Response. Write(di. Key +" : "+di. determine); Response. Write("<br>"); } } }

Forex Groups - Tips on Trading

Related article:
http://www.w3exchange.com/view_topic.php?pid=5172#5172

comments | Add comment | Report as Spam


"example of Server.Transfer and Context Handler in Script Forums ..." posted by ~Ray
Posted on 2007-11-03 13:49:00

This is an example of Server. assign and Context Handler. Through this we can get the multiple values of previous form. In this summon we are displaying data from previous form. We can use this technique for multiple create registration form. label (ContextParent aspx cs): -private void add1_move(disapprove sender,System. EventArgs e) { Server. Transfer("ContextChild aspx"); } internal Hashtable Value { get { Hashtable objHT = new Hashtable(); objHT["label"]=TextBox1. Text; objHT["FathersName"]= TextBox2. Text; objHT["Address"] = TextBox3. Text; return objHT; } }label (ContextChild aspx cs) :-private cancel summon_fill(disapprove sender. System. EventArgs e) { // Put user code to initialize the summon here Hashtable objHT = new Hashtable(); if(!IsPostBack) { ContextParent ParentPage; ParentPage = (ContextParent)Context. Handler; objHT = ParentPage. Value; Response. Write("<br><br>"); foreach(DictionaryEntry di in objHT) { Response. create verbally(di. Key +" : "+di. determine); Response. Write("<br>"); } } }

Forex Groups - Tips on Trading

Related article:
http://www.w3exchange.com/view_topic.php?pid=5172#5172

comments | Add comment | Report as Spam


"BCL Refresher: Converting the Non-Generic Collections [Inbar Gazit]" posted by ~Ray
Posted on 2007-10-28 11:47:01

As you experience generics were only introduced to the. NET Framework in version 2.0. Originally we had a lot of collections in the System. Collections namespace that can hold on objects. In version 2.0 we added the System. Collections. Generic namespace to support generic collections that can hold on any specific write. If you have legacy code or change surface if you kept using the old non-generic collections for other reasons you may be to consider converting your label to use the generic collections instead. Here are a few reasons why: Readability and simplicity of your code. Let’s act the arrange in a enumerate of strings. With generics you would declare List<T> myList = new enumerate<T>(); and then say arrange firstString = myList[0] just like working with arrays. This syntax is much more simple and readable than what you used to have to create verbally which was ArrayList myList = new ArrayList(); and then string firstString = myList[0] as string; Performance. Every time you add a value write to a non-generic collection you undergo to box it to alter it an disapprove and every time you retrieve a determine type from a non-generic collection you undergo to unbox it back from disapprove. change surface with reference write you still need to cast approve to the change by reversal write when retrieving items. Working against new smaller Framework SKUs. In Silverlight we decided to remove all the concrete non-generic collections completely from the codebase. This is mostly because the Silverlight core managed libraries is set to be the smallest useful set of classes. It’s also possible that other future small frameworks will not have the non-generic collections in store. If you ever intend to frameworks — you should convert it to use the generic collections. Better type-safe libraries. If you are developing libraries to be consumed by 3rd parties you should most definitely use generic collections when possible. This would accept consumer of your libraries to quickly evaluate out what’s expected to be stored in the collections instead of having to guess or evaluate out from documentation. OK so now I convinced you that you should go back and rewrite your existing code (not to have in mind any new code you’re writing) to use generic collection but how exactly should you go about it? Luckily most of the non-generic collections (with the exception of BitArray) have very good generic counterparts. The following delay illustrates what type to replace for what: Non-generic Generic replacement ArrayList List<T> BitArray List<Boolean> [say that this isn’t stored as compactly as BitArray but represents the same information] CaseInsensitiveComparer Comparer<T> CaseInsensitiveHashCodeProvider Comparer<T> CollectionBase Collection<T> Comparer Comparer<T> CompatibleComparer Comparer<T> DictionaryBase KeyedCollection<K,V> DictionaryEntry KeyValuePair<K,V> Hashtable Dictionary<K,V> KeyValuePairs KeyValuePair<K,V> Queue Queue<T> ReadOnlyCollectionBase ReadOnlyCollection<T> SortedList List<T> lade Stack<T> sight that in most of these cases you would have to evaluate out what the T is in the generic class. This assumes you used to store just one write of elements in your collection. If are storing more than one write you should find the common base-class. In the worse inspect you can use disapprove but that would suffer most of the benefits of generics. Let’s look at an example: This is the old label using non-generic Stack: using System; using System. Collections; Stack MRUFiles = new Stack(); MRUFiles. Push(”first”); MRUFiles. Push(”back up”); MRUFiles. Push(”third”); Console. WriteLine(MRUFiles. Pop() as arrange); Console. WriteLine(MRUFiles. look() as string); Console. WriteLine(MRUFiles. Pop() as string); Console. WriteLine(MRUFiles. Count. ToString()); Same code would look desire this using generic Stack<String>: using System; using System. Collections. Generic; Stack<string> MRUFiles = new lade<string>(); MRUFiles. Push(”first”); MRUFiles. displace(”back up”); MRUFiles. displace(”third”); Console. WriteLine(MRUFiles. Pop()); Console. WriteLine(MRUFiles. Peek()); Console. WriteLine(MRUFiles. Pop()); Console. WriteLine(MRUFiles. ascertain. ToString()); Additional considerations when making the dress: List<Boolean> is not a good enough replacement for BitArray when it comes to the use of memory. If you undergo a enumerate of millions of bits using a BitArray would have a much smaller memory footprint than enumerate<Boolean> since it’s actually manipulating bits instead of storing each bit as a Boolean that takes 8 bits each. In addition methods such as And. Xor. Not. Or and SetAll will not exist and you’d have to implement them yourself Dictionary<K,V> indexer behaves differently than Hashtable did when the key is not found. With Hashtable you would get a null whereas with Dictionary you would get a KeyNotFoundException. So you would.

Forex Groups - Tips on Trading

Related article:
http://cliftonkeefeaur.muwordpress.com/2007/08/22/bcl-refresher-converting-the-non-generic-collections-inbar-gazit/

comments | Add comment | Report as Spam


"BCL Refresher: Converting the Non-Generic Collections [Inbar Gazit]" posted by ~Ray
Posted on 2007-10-28 11:46:55

As you experience generics were only introduced to the. NET Framework in version 2.0. Originally we had a lot of collections in the System. Collections namespace that can store objects. In version 2.0 we added the System. Collections. Generic namespace to support generic collections that can store any specific write. If you undergo legacy label or change surface if you kept using the old non-generic collections for other reasons you may be to believe converting your code to use the generic collections instead. Here are a few reasons why: Readability and simplicity of your code. Let’s take the string in a enumerate of strings. With generics you would declare List<T> myList = new List<T>(); and then say string firstString = myList[0] just desire working with arrays. This syntax is much more simple and readable than what you used to undergo to create verbally which was ArrayList myList = new ArrayList(); and then arrange firstString = myList[0] as string; Performance. Every measure you add a value write to a non-generic collection you have to box it to make it an object and every time you retrieve a determine type from a non-generic collection you undergo to take out it back from object. Even with reference type you comfort need to direct back to the correct type when retrieving items. Working against new smaller Framework SKUs. In Silverlight we decided to remove all the concrete non-generic collections completely from the codebase. This is mostly because the Silverlight core managed libraries is set to be the smallest useful set of classes. It’s also possible that other future small frameworks will not have the non-generic collections in store. If you ever plan to frameworks — you should convert it to use the generic collections. Better type-safe libraries. If you are developing libraries to be consumed by 3rd parties you should most definitely use generic collections when possible. This would allow consumer of your libraries to quickly figure out what’s expected to be stored in the collections instead of having to anticipate or evaluate out from documentation. OK so now I convinced you that you should go back and revise your existing code (not to mention any new label you’re writing) to use generic collection but how exactly should you go about it? Luckily most of the non-generic collections (with the exception of BitArray) have very good generic counterparts. The following table illustrates what type to replace for what: Non-generic Generic replacement ArrayList enumerate<T> BitArray enumerate<Boolean> [say that this isn’t stored as compactly as BitArray but represents the same information] CaseInsensitiveComparer Comparer<T> CaseInsensitiveHashCodeProvider Comparer<T> CollectionBase Collection<T> Comparer Comparer<T> CompatibleComparer Comparer<T> DictionaryBase KeyedCollection<K,V> DictionaryEntry KeyValuePair<K,V> Hashtable Dictionary<K,V> KeyValuePairs KeyValuePair<K,V> stand Queue<T> ReadOnlyCollectionBase ReadOnlyCollection<T> SortedList enumerate<T> Stack Stack<T> Notice that in most of these cases you would have to figure out what the T is in the generic categorise. This assumes you used to store just one type of elements in your collection. If are storing more than one type you should find the common base-class. In the worse case you can use Object but that would lose most of the benefits of generics. Let’s be at an example: This is the old label using non-generic lade: using System; using System. Collections; lade MRUFiles = new Stack(); MRUFiles. Push(”first”); MRUFiles. Push(”back up”); MRUFiles. displace(”third”); Console. WriteLine(MRUFiles. Pop() as string); Console. WriteLine(MRUFiles. Peek() as string); Console. WriteLine(MRUFiles. Pop() as string); Console. WriteLine(MRUFiles. ascertain. ToString()); Same label would look desire this using generic lade<String>: using System; using System. Collections. Generic; Stack<arrange> MRUFiles = new Stack<string>(); MRUFiles. Push(”first”); MRUFiles. Push(”back up”); MRUFiles. Push(”third”); Console. WriteLine(MRUFiles. Pop()); Console. WriteLine(MRUFiles. Peek()); Console. WriteLine(MRUFiles. Pop()); Console. WriteLine(MRUFiles. Count. ToString()); Additional considerations when making the dress: enumerate<Boolean> is not a good enough replacement for BitArray when it comes to the use of memory. If you have a list of millions of bits using a BitArray would have a much smaller memory footprint than List<Boolean> since it’s actually manipulating bits instead of storing each bit as a Boolean that takes 8 bits each. In addition methods such as And. Xor. Not. Or and SetAll ordain not exist and you’d undergo to implement them yourself Dictionary<K,V> indexer behaves differently than Hashtable did when the key is not found. With Hashtable you would get a null whereas with Dictionary you would get a KeyNotFoundException. So you would.

Forex Groups - Tips on Trading

Related article:
http://cliftonkeefeaur.muwordpress.com/2007/08/22/bcl-refresher-converting-the-non-generic-collections-inbar-gazit/

comments | Add comment | Report as Spam


"Serialization of a class that inherit from HashTable (or any class ..." posted by ~Ray
Posted on 2007-10-23 15:43:43

This is another funny problem related to serialization. Have you serialized a class and when deserialized again all the field values are set to fail values? Well analyse if this is your case: If you have a class (Class1) that inherits from another one that is ISerializable (i e. HashTable). come up as the categorise1 categorise inherits from hashtable and hastable implements ISerializable you be to create verbally the special constructor above but once you write the constructor you are telling net that you will be in charge of saving the data you really be to save… If you deliver no information for your fields no data is saved when serialized so no data is retrieved when deserialized. The quick (and dirty ;) ) way to solve this: Use reflection to automatically go across the properties and deliver them instead of write code to deliver them one by one: [Serializable]class categorise1: Hashtable{ public Class1(SerializationInfo info. StreamingContext context) : locate(info context) { FieldInfo[] fields = this. GetFields(this); foreach (FieldInfo fieldInfo in fields) { Object obj = info. GetValue(fieldInfo. Name,fieldInfo. FieldType); fieldInfo. SetValue(this,obj); } } public override void GetObjectData(SerializationInfo info. StreamingContext context) { FieldInfo[] fields = this. GetFields(this); foreach (FieldInfo fieldInfo in fields) { info. AddValue(fieldInfo. label,fieldInfo. GetValue(this)); } locate. GetObjectData(info context); } public categorise1() { } protected int number; private int othernumber; public string text;

Forex Groups - Tips on Trading

Related article:
http://netexperiments.blogspot.com/2007/08/serialization-of-class-that-inherit.html

comments | Add comment | Report as Spam


"Recomendamos: Filling a ComboBox using HashTable in VB.NET" posted by ~Ray
Posted on 2007-10-17 14:46:27

Publicado en C# Tuningpor Pavithra86Filling a ComboBox using HashTable in VB. NET 20 08 2007 This tutorial is also about filling a Combo box but using HashTable. What is a Hashtable? Hashtable is a collection of label/value pairs of objects that allow retrieval by label or list i e it is used to do mapping of key/determine pairs. For example,if you want to map the email address and beat name of user,you could use a Hashtable. In order to use a hashtable we must import a namespace System. Collections. Imports System. Collections. Hash...

Forex Groups - Tips on Trading

Related article:
http://superdotnet.blogspot.com/2007/08/recomendamos-filling-combobox-using.html

comments | Add comment | Report as Spam


 

 




blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




the hashtable archives:

11 articles in 2006-01
22 articles in 2006-02
27 articles in 2006-03
36 articles in 2006-04
27 articles in 2006-05
26 articles in 2006-06
24 articles in 2006-07
18 articles in 2006-08
22 articles in 2006-09
30 articles in 2006-10
22 articles in 2006-11
22 articles in 2006-12
12 articles in 2007-01
12 articles in 2007-02
3 articles in 2007-03
7 articles in 2007-04
11 articles in 2007-05
10 articles in 2007-06
3 articles in 2007-07
1 articles in 2007-09




next page


hashtable