|
mr brown posted:Victor makes an excellent point here, I neglected to read the stacktrace.
|
# ? Jan 19, 2007 19:09 |
|
|
# ? Jun 10, 2024 11:59 |
|
Boogeyman posted:Here's how I usually do it. It might not be the most efficient way (I've never messed with anything else), but it works. After more testing, I came to realize that this code doesn't do what I thought it would do. I thought it would iterate through each node and treat it as a seperate element, but it instead goes through each node and concatenates the InnerText strings into one big string, then returns that. So, my question is, how could I iterate through child nodes, grab the InnerText of each one, then put each InnerText of a node in an ArrayList? For example, say this is my XML file: code:
Thanks as always.
|
# ? Jan 19, 2007 19:50 |
|
pliable posted:After more testing, I came to realize that this code doesn't do what I thought it would do. I thought it would iterate through each node and treat it as a seperate element, but it instead goes through each node and concatenates the InnerText strings into one big string, then returns that. Piece of cake! This should do it... code:
|
# ? Jan 19, 2007 20:00 |
|
Jethro posted:It seems to me that Victor's idea of using a constructor is the best idea. If you just wanted a ChildClass object to always know what it's a member of, then what happens if you make a ChildClass object that isn't a member of anything? And if you would never, ever, ever do that, then why would you ever want to access the Parent through the Child when you'll always have the Parent sitting around? I'm already using a constructor, and it works fine but is a bit tedious. There's also the issue with the System.Runtime.Serialiazation engine not calling the constructor when deserializing (I'm still amazed it can do this). I want the Child itself to have access to the properties of the Parent. So when a Step returns a bit of text, it can know the overall context of the document it's a part of and use that in it's logic. If the child doesn't actually belong to a parent, then I can deal with nulls just fine. I guess I'm just way off base. When I get the puzzled looks (or in this case replies) to a question like this, it's usually a good indicator I'm doing something wrong and there's a simpler/better way to accomplish my goals.
|
# ? Jan 19, 2007 20:02 |
|
pliable posted:After more testing, I came to realize that this code doesn't do what I thought it would do. I thought it would iterate through each node and treat it as a seperate element, but it instead goes through each node and concatenates the InnerText strings into one big string, then returns that. code:
code:
Fiend fucked around with this message at 20:19 on Jan 19, 2007 |
# ? Jan 19, 2007 20:13 |
|
ArrayList is easier than that.code:
|
# ? Jan 19, 2007 20:20 |
|
fankey posted:What's a good technique to inspect/interact with the Garbage Collector so I can make sure I don't have any dangling references hanging out there. I've looked at System.GC and there doesn't appear to be a way to list the objects that are ready for collection. At certain points in my code I should be 'releasing' all references to particular objects - I'd just like to verify that it's actually happened. http://memprofiler.com/ You still have to have a pretty good idea where to look, and you should always know when to use a using statement or other Dispose/cleanup construct. I had to change the entire messaging core of my program to use WeakReferences at one point, because there was no reliable way to determine an object's scope at design time. So sometimes the solution isn't obvious.
|
# ? Jan 19, 2007 20:21 |
|
Boogeyman posted:Piece of cake! This should do it... That didn't work, since DocumentElement is a property . Is it a method in Visual Basic? I'm not very familiar with VB, so. Dromio posted:ArrayList is easier than that. Booyah, loving perfect. I love you guys . EDIT: Ah ballhair, one more question... If no inner text was present (ex: <BallSack></BallSack>), and currentNode.InnerText was called...what in the gently caress does it return? I tried doing an if statement to test and see if it was and empty string or null, and it's apparently none of them. I'm confused . EDIT 2: Ah wait, I have to call ToString() on the ArrayList to properly test. poopiehead posted:It should be an empty string. <3 pliable fucked around with this message at 21:28 on Jan 19, 2007 |
# ? Jan 19, 2007 20:53 |
|
pliable posted:That didn't work, since DocumentElement is a property . Is it a method in Visual Basic? I'm not very familiar with VB, so. It should be an empty string. code:
code:
|
# ? Jan 19, 2007 21:06 |
|
Dromio posted:I'm already using a constructor, and it works fine but is a bit tedious. There's also the issue with the System.Runtime.Serialiazation engine not calling the constructor when deserializing (I'm still amazed it can do this). That being said, I don't think MS has included any serialization code that understands parent properties -- I think you'll have to do that on your own. Don't take this comment as official, as I have not dug into serialization much. As you've discovered, doing it right when the data structure is anything beyond simple can be a pain. It'd be nice to see a site where these different patterns are codified and tradeoffs explained. It's on my todo list...
|
# ? Jan 19, 2007 22:10 |
|
pliable posted:That didn't work, since DocumentElement is a property . Is it a method in Visual Basic? I'm not very familiar with VB, so. Well, poo poo...guess that's what I get for posting code without testing it first. It's a property in Visual Basic, and I'm not sure why it didn't work. Not that it matters, you got a working answer from Dromio.
|
# ? Jan 19, 2007 22:24 |
|
Dromio posted:I'm already using a constructor, and it works fine but is a bit tedious. There's also the issue with the System.Runtime.Serialiazation engine not calling the constructor when deserializing (I'm still amazed it can do this). It would seem that the best way to do it is to not even think about the _ParentStep member when you're (de)serializing the StepTextCollection, or whatever. When you deserialize the Step, do something like code:
|
# ? Jan 19, 2007 22:46 |
|
hey guys, question about deploying a web service project... whats the proper way to do this? right now, whenever I have updates and need to redeploy. I am copying over the project folder (say the webservice is 'service') directly over the previous one. But when I access the service it always seems to load the previous version until after some amount of time, when it will start to load the new one. There seems to be some caching going on but I don't know how to flush it to force it to load the new version or even if this is the correct procedure for deploying a webservice. I'm developing this in VS2005 for asp.net 2.0
|
# ? Jan 19, 2007 23:58 |
|
Have you tried doing an iisreset on the server?
|
# ? Jan 20, 2007 00:43 |
|
Jethro posted:Have you tried doing an iisreset on the server? I haven't, but this is a production server so hopefully there is a better solution.
|
# ? Jan 20, 2007 00:47 |
|
I'll admit I don't know a ton about webservices, but I'm going to bet that iisreset and "wait some indeterminate amount of time" are going to be your main two options. On the plus side, iisreset doesn't take too long, so if you can find a low-usage time you shouldn't break too much poo poo.
|
# ? Jan 20, 2007 00:54 |
|
pqweriou posted:hey guys, question about deploying a web service project... ASP.NET is very, very smart. It keeps serving old requests using the previous versions of the dlls until it can clear them out, then will unload the app domain and load the new stuff. As for deployment: 1) Do not deploy project files. You should be deploying outputs only. Easy way to get there is to use the Deployment wizard in VS 2005 to deploy the site to a local folder. 2) Depending on how much access you have to the server, a valid tactic might be to create a new folder for the service, then point the virtual site/directory there. 3) Another option would be to put the service in its own app pool, then recycle that when you redeployed, forcing it to reload the server. I would also advise communicating to clients about downtime. PS: quote:I'm already using a constructor, and it works fine but is a bit tedious. There's also the issue with the System.Runtime.Serialiazation engine not calling the constructor when deserializing (I'm still amazed it can do this). Don't be so amazed. It's called reflection and it is pretty drat powerful.
|
# ? Jan 20, 2007 01:11 |
|
I have another issue. On another machine, with the same configuration, after IIS is installed and ASP.NET is reregistered with aspnet_regiis -i, I experience this fuckery:code:
EDIT: Already uninstalled and reinstalled with aspnet_regiis Fiend fucked around with this message at 02:10 on Jan 20, 2007 |
# ? Jan 20, 2007 01:54 |
|
Boogeyman posted:Well, poo poo...guess that's what I get for posting code without testing it first. It's a property in Visual Basic, and I'm not sure why it didn't work. Not that it matters, you got a working answer from Dromio. Yeah, it's all good in the hood. I appreciate you trying anyways . Now I just need to hope that my boss won't care too much that my website is a week late....
|
# ? Jan 20, 2007 02:42 |
|
fankey posted:What's a good technique to inspect/interact with the Garbage Collector so I can make sure I don't have any dangling references hanging out there. I've looked at System.GC and there doesn't appear to be a way to list the objects that are ready for collection. At certain points in my code I should be 'releasing' all references to particular objects - I'd just like to verify that it's actually happened. Windbg is really good and packed with functionality, but has a pretty sharp learning curve. This MSDN blog does a pretty great job at explaining how to use it with ASP.NET (or .NET in general, really); the author is a MS employee in Product Support Services.
|
# ? Jan 20, 2007 02:49 |
|
Basically, I'm struggling to get properties to show up in the Properties window. From the docs I've read, it should happen by default. And I quotequote:By default, all public control properties implemented with an explicit pair of get/set accessors show up in the Visual Studio .NET Properties window. Did something change in VS2005? Am I missing something completely obvious? Should I go back to the boatyard and ask for my old job grinding fiberglass back? I made pictures rather than trying to explain what's going on because it seemed easier. 1) I create a property like so 2) I look at the class diagram. Looks okay to me. (click for readability) 3) Why is the "Testing" category and the "ChannelCount" property not appearing in the properties window? (again, clicky) edit: I don't need to supply a custom UITypeEditor for the basic value types like int, do I? goose on fire fucked around with this message at 03:00 on Jan 20, 2007 |
# ? Jan 20, 2007 02:57 |
|
goose on fire posted:Basically, I'm struggling to get properties to show up in the Properties window. Don't hate me for asking, but have you recompiled the UserControl? quote:edit: I don't need to supply a custom UITypeEditor for the basic value types like int, do I? Not unless VS2005 is actually stupider than VS2003, and I just don't think that's possible
|
# ? Jan 20, 2007 03:03 |
|
csammis posted:Don't hate me for asking, but have you recompiled the UserControl? goose on fire posted:Am I missing something completely obvious? As soon as you switch to a form and drag that control onto it (from the Toolbox where it magically appeared), the properties for that instance will show up in the properties window. (I hate it when I spend two hours on something like that. It didn't click until I switched over to designing the form and saw the control in the toolbox. Argh.)
|
# ? Jan 20, 2007 16:44 |
|
I'm learning how to do asynchronous sockets in C#. I'm worried about memory usage. I look at taskmgr to see how memory is being used and it seems to go up more than it goes down . Here is how I'm receiving data from the socket. Is this way good enough or can it be improved to be more memory conscious?code:
|
# ? Jan 21, 2007 02:06 |
|
JediGandalf posted:I'm learning how to do asynchronous sockets in C#. Looks fine to me, except you don't have to pass _recvsocket as the AsyncState since it's already a private member variable. One thing I do to save an allocation in this scenario is to use only one AsyncCallback instead of declaring a new one each time you read from the socket: code:
|
# ? Jan 21, 2007 02:14 |
|
This thread is pretty much way, way over my head as far as programming goes but I have a question that is slightly .NET related. I've been teaching myself C++ for about a year now, just recently moving from writing console programs to actual Windows programs using the Win32 API(not MFC) in XP. From what I understand the .NET framework seems to be the greatest thing ever invented as far as Windows development goes, and I assume Vista was built to support .NET first and foremost. My question is, does Vista use the same API as Windows XP? If I were to install Vista, fire up the new Visual Studio C++, create a project and call Win32 functions (minor differences aside I assume) like I was kickin' it in XP, would it compile and run pretty much the same way? I hope that isn't to vauge. I've googled the hell out of google trying to find a decent answer and I haven't found anything I understand. Hopefully one of you can put it into words I can.
|
# ? Jan 21, 2007 07:45 |
|
theJustin posted:My question is, does Vista use the same API as Windows XP? If I were to install Vista, fire up the new Visual Studio C++, create a project and call Win32 functions (minor differences aside I assume) like I was kickin' it in XP, would it compile and run pretty much the same way? Yes it would.
|
# ? Jan 21, 2007 09:02 |
|
theJustin posted:This thread is pretty much way, way over my head as far as programming goes but I have a question that is slightly .NET related. I've been teaching myself C++ for about a year now, just recently moving from writing console programs to actual Windows programs using the Win32 API(not MFC) in XP. From what I understand the .NET framework seems to be the greatest thing ever invented as far as Windows development goes, and I assume Vista was built to support .NET first and foremost.
|
# ? Jan 21, 2007 09:08 |
|
Book Question: I'm sure this has been asked before, but it's kinda difficult to search for c#, being two characters and all. I'm looking for a good C#/.NET book, or other resource. Pretty much all of my programming would be for use with my company's SharePoint server. As far as my programming experience goes:
So, as I mentioned before, I was looking for a book. Does anyone have any experience with Learning C# 2005: Get Started with C# 2.0 and .NET Programming? Would my lack of OOP knowledge make this a good book for me, or would people suggest just diving right in to Programming C#, or is there a better book that you would suggest?
|
# ? Jan 22, 2007 19:08 |
|
Jethro posted:Book Question: Progamming C# might be a bit tough with no OO experience. I've heard good things about(but have not read myself) Learning C# for less OOP experienced people. poopiehead fucked around with this message at 20:19 on Jan 22, 2007 |
# ? Jan 22, 2007 19:42 |
|
poopiehead posted:I've heard good things about(but have not read myself) Learning C# for less OOP experience people.
|
# ? Jan 22, 2007 20:05 |
|
Goonamatic posted:Any know of an open source bittorrent client written in c#? http://www.monotorrent.com/ It's kinda a satellite project of the Mono Project, so it's well-supported.
|
# ? Jan 22, 2007 23:46 |
|
mr brown posted:Windbg is really good and packed with functionality, but has a pretty sharp learning curve. This MSDN blog does a pretty great job at explaining how to use it with ASP.NET (or .NET in general, really); the author is a MS employee in Product Support Services. Thanks. That's pretty much exactly what I was looking for. I've already found a few dangling references due to unremoved events. It looks like you can use the sos.dll debug stuff either from windbg or within VS2005 - is one better than the other as far as features go?
|
# ? Jan 23, 2007 01:36 |
|
For those who use MembershipProvider, ProfileProvider and IPrincipal/IIdentity: do you have preferences for where you store the different pieces of information about a user? I get that the RoleProvider should cache roles, but where, say, telephone number goes, seems a bit up in the air. I'm leaning towards storing settings in the profile and most of the single-instance (like phone number) data in the MembershipUser (which is distinct from IPrincipal, right?). Do I put authentication-related info in (an object implementing) IPrincipal instead of MembershipUser? What about IIdentity? I wish there were a succinct diagram somewhere showing what information goes where, who gets information from whom, when that happens, and how to use it. I have taken some notes; I dunno if they'd be helpful to anyone. I feel like I'm finally cracking the authentication/authorization/user info puzzle! I just need a few tips.
|
# ? Jan 23, 2007 08:42 |
|
biznatchio posted:http://www.monotorrent.com/ Perfect thanks!
|
# ? Jan 23, 2007 08:50 |
|
Paging wwb or some other experienced ASP.NET goon to the thread. (My question is two posts above.)
|
# ? Jan 23, 2007 19:51 |
|
Victor posted:Paging wwb or some other experienced ASP.NET goon to the thread. (My question is two posts above.) I tend to treat Authentication/Authorization/UserInfo as 3 separate concerns. I let my http module or whatever handle the auth stuff and then if I need some other form of user info beyond the user name and role I look it up in Session Start or something and cache it in Session. I have an employee domain object which is hydrated from an authoritative db table with all the goodies I need in it. Alternatively, a small subset of the info I need is sync'd with Active Directory, so I can query some of it from there. We have a more unified auth scheme, while each of our apps needs a varying set of user info, so it makes sense not to couple them too tightly.
|
# ? Jan 23, 2007 20:34 |
|
I'm trying to make the defaultbutton for a textbox be a linkbutton. Sounds simple enough, but not really. There seems to be a bug(or at least weird feature) in ASP .NET that makes this not possible on firefox. Looking at their JS, they try to use the defaultbutton's click() method which firefox doesn't define for anchor tags. This script fixes it so that there is a click method. code:
Is there anything wrong with this besides the fact that if MS changes their LinkButton Control, then my code might die?
|
# ? Jan 23, 2007 23:28 |
|
I am with [kinda sorta] havelock. I view authorization and authentication data as something that should be separated from application data, such as detailed user info.
|
# ? Jan 23, 2007 23:46 |
|
|
# ? Jun 10, 2024 11:59 |
|
I'm still confused. While MembershipProvider provides a ValidateUser method, it doesn't seem MS intended it to be restricted to authorization; otherwise, why would MembershipUser not implement IPrincipal or IIdentity? Let me put this another way: does anyone here use IPrincipal, MembershipUser, and ProfileProvider, all in the same app? Do you typically maintain a 1:1 relationship between MembershipUser/IPrincipal and your custom, non-provider-model-based user data? If I'm understanding you guys correctly, you don't find that ASP.NET provides any natural provider-model-supported location for user info like telephone number? It appears that it *does* have support for stuff like user options in ProfileProvider, and that it is reasonable to have multiple profiles for a given MembershipUser.
|
# ? Jan 24, 2007 00:03 |