|
viaducting wrote: Is there a missing " at the end of that line?
ops..thnQ..I correct it
|
|
|
|
|
|
Manfred R. Bihy wrote: Is this a repost of this?
no,i think my programming in that post is wrong..
this question is before that method happen.
|
|
|
|
|
Thats a good way to get hacked by a first grader who read up on SQL injection.
|
|
|
|
|
I found the answer:
with Going to web.config and adding this code in system.web section:
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
good luck.
|
|
|
|
|
Hi all,
I want to derive a class from LinkedListNode<t> so that the nodes themselves contain the data values, but cannot as the class is sealed - any reason why this should be so? If I create a standard LinkedList of classes, the classes themselves do not know about the Next and Previous nodes, because the value of each node is stored in LinkedListNode<T>.Value.
Do I need to write my own doubly-linked list to achieve this or can this limitation be overcome? I suspect I'm probably missing something obvious!
|
|
|
|
|
viaducting wrote: any reason why this should be so?
There are probably plenty of reasons the team who created this marked it as sealed. Ask them.
LinkedListNode is just a pointer to the node within the LinkedList, which, as it is a generic collection, can contain any validate object. You don't need to extend LinkedListNode or create your own LinkedList implementation.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Under the existing implementation only a LinkedListNode can be used to walk along the list. The data within it cannot access the Next and Previous links. I want to store data that needs to access the adjacent nodes, so I don't think the standard implementation will work unmodified.
|
|
|
|
|
I see two ways for you:
1.
use LinkedListNode as intended, and provide a backlink from your actual node data to the LinkedListNode it belongs to.
2.
roll your own linked list. It isn't that hard.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
modified on Tuesday, January 11, 2011 9:33 AM
|
|
|
|
|
1. Is the way I am heading via an overloaded LinkedList where all the Add... functions will set this up automatically.
2. I know it isn't hard but I was trying to avoid doing it!
|
|
|
|
|
viaducting wrote: If I create a standard LinkedList of classes, the classes themselves do not know about the Next and Previous nodes
And usually they should not. For example, if I want a LinkedList<invoice>, the Invoice objects I put into the list do not have to know anything about next or previous, this information has nothing to do with Invoice type. Other way, if I created a single Invoce, what would be supposed to be the values of Next and Previous? Should it create a complete linked list for just opening one?
viaducting wrote: Do I need to write my own doubly-linked list to achieve this or can this limitation be overcome?
I don't think it is a limitation. It is a well designed class for a LinkedList. If you need something special, I guess you will have to make a new class, but I'm afraid I cannot give you any further help unless you give us a little more information of what you need to do.
|
|
|
|
|
You might not need to for a list of invoices, but there are other situations where it would be very useful. For example, if you have a list of points representing a polygon it is useful to be able to access the adjacent nodes so that joints can be re-built if one of the points moves.
|
|
|
|
|
Yes, that's why I said "usually". However, I think we are on the same case for points representing a polygon. Point is a well defined class, and Next or Previous have nothing to do with it. This information might make some sense in a Polygon class, but not in the points themselves. Please, tell us something else about what you pretend to do. Maybe some of us can give you a good approach.
|
|
|
|
|
I don't really agree here. In your example, it is a list of points, each point exists by itself. Drawing a poly-line, or moving/merging points, or performing whatever other operation that goes beyond a single point, would be an operation on the overall object, the polyline, which can access all the points. At the point level, there is no need to access other points, and when there is a need, it has to be organized on the higher level.
Of course if performance is your primary concern, things may well be different. And then I wouldn't use a pre-existing class unless it suits my needs perfectly.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I would agree with you if everything was static, but if you have a polyline with radius blends, and one point moves, then to rebuild the blend the point that changed only needs to look at the adjacent points, not the whole line. It seems inefficient to have to call another function in the (theoretical) Polyline class to rebuild everything when the point itself knows that its position has just changed.
Maybe I'm trying to over-optimise the efficiency and reducing the simplicity instead.
|
|
|
|
|
Perhaps your points can raise an event that the line is listening for?
somepoint.OnMoved += PointMovedHandler
Besides, aren't Points immutable? Wouldn't a "move" really be a replacement of one Point with another? (Hmmm... it seems they're not... I think they should be. Ah well.)
|
|
|
|
|
In the FrameWork they are one of the very few exceptions.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Events looks like a good way to go, but I would still prefer to access the Next/Previous nodes directly, I think it'd be more efficient. Looks like I need to code my own.
|
|
|
|
|
|
Hello,
I am populating a queue inside a windows service.
The windows service is now installed and started on my machine.
I can see in the eventlog that the queue is indeed populated i.e. enqueue and Dequeue...
In the windows service, there is a simple method i.e. getQueueData which should return what is inside the queue.
While the windowsservice is running, I start a wcf project which has a reference to the getQueueData method inside the windowsservice.
Question:
Should the wcf return the queue as it is showing inside the eventlog? I mean, while I see the queue being populated, the at the same time when I run the wcf, then should the wcf return the number of items in the queue? I ask because the wcf only seems to think there is always zero items in the queue whilst I see the eventlog and queue has data in it.
Have I done everything correctly?
Thanks
|
|
|
|
|
arkiboys wrote: Have I done everything correctly?
Obviously not. If your queue has data in it, and you can't see it then you haven't done everything correctly. Without seeing your code, I'm going to take a flier as a guess - your queue is not a singleton inside the windows service, and the WCF functionality is seeing a different instance. As I say though, we can't do anymore to diagnose the issue because we have no idea what your code is.
What you could do, is attach your debugger to the running instance of the service and actually step through the code and see what's going on. That would be my choice.
|
|
|
|
|
Hi,
Do you mean the following ?
1- start the windows service in the services list
2- in th ewindows service project, debug, attach to process, select the windows service from the list.
If thi sis what you mean, then i do not see the windows service that I started in the list of the attach to process window.
Thanks
|
|
|
|
|
Is the WCF service hosted by your Windows service?
Or is a different executable?
If the second, obviously the WCF service sees an empty queue, because it references a different object from the one used by the Windows service.
|
|
|
|
|
Yes, the wcf is separate to windows service.
|
|
|
|
|
Then, as I said, the queue you use in the WCF service is different from the one populated in the Windows service.
The WCF service must be hosted by the Windows service and reference the same instance of the queue.
See here for hosting WCF services in custom applications.
|
|
|
|