|
Escape char as seperator ...maybe I'm misunderstanding the question, but wouldn't you simply type a double §§ in the regex string?
|
|
|
|
|
Sorry if I was not clear enough,
if I use "§§" as a pattern the split of "abc§123§§456§§§xyz" will give
abc§123
456
§xyz
and this is not my expected
abc
123§456§
xyz
To try to make it clearer let's say that in the original string a substring like "§§" is to be understood as :
since a "§" is followed by another "§" , then in the result string this second "§" is to be kept as is and not considered to be a separator
(think of "\" instead of "§" if you prefer : "\\" means a real '\' not to be considered as a 'special' char. ... but that makes things quite unreadable in regex patterns)
Thanks
Marc
hooktrack.girollet.com
|
|
|
|
|
I tried a couple of different regexes but wasn't able to accomplish this. Perhaps this is better asked in a regex forum?
|
|
|
|
|
Thanks much to have drop an eye, and spent of your time on this topic
I'll take your advice and try the regex forum
Take Care
Marc
|
|
|
|
|
hai,
I want to be able to set the PictureBox.AllowDrop property in the designer
but it doesn't appear in the properties list.Other controls like Panel do show this property but not PictureBox. Why is this?
how can i drag a picture from one picture box to other
sree
|
|
|
|
|
You mean in the designer, or in your app ? The picture box does not support this behaviour in your app. You'd have to write it yourself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
I have been busy getting my skills up with C# Windows development because I been working with ASP.NET for ways too long.
I have been looking into Remoting with C# , and I would like to know is there a way I can use Visual Studio's databinding tools with the development of a Remoting site.
As in a Server tier that contains the database , with a remote layer between that and multiple client applications ?
I have worked with Java RMI before So I am not that new to Remoting or CORBA.
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
Chona1171 wrote: s there a way I can use Visual Studio's databinding tools with the development of a Remoting site.
A remoting site? What do you mean by "remoting site"?
And no, Visual Studio's databinding tools don't work with remoting at all. Instead, you use remoting to get data to and from the server, then you can bind to the resulting objects as necessary.
|
|
|
|
|
Sorry what I meant to say was a remote server application
Le Roux Viljoen
Web Developer
PCW New Media
South African Branch
www.pcwnewmedia.com
|
|
|
|
|
Ok. Given that you're going to be working with a .NET remoting server, what is your question?
|
|
|
|
|
I am trying to fetch some data from the net. I want to show the progress bar to show the percentage of download.
How can i effectively set the value of progress bar,according to the download
My small attempt...
|
|
|
|
|
Well, which bit do you need help with ? How are you doing the download ? Do you know how big the file is, and how much you've downloaded ? If so, it's trivial to set a progress bar. If not, it's not possible.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Actually i am try to do one web service.
My c# application will fetch a dataset with two tables from the server. I cant tell the size of the dataset.
i just want to see a progress bar to show the progress of this operation,like download in windows
My small attempt...
|
|
|
|
|
sujithkumarsl wrote: I cant tell the size of the dataset.
i just want to see a progress bar to show the progress of this operation,like download in windows
Windows knows the size of the downlaod. How can you tell someone how close they are to finishing, if you don't know the size ? You can do a progress bar that just moves back and forth, but not one that tells people how long it will take.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes. i know that.....
Actually i am getting the dataset as a return type by the webservice.....
Is there any relevent method to sortout my problem?
My small attempt...
|
|
|
|
|
No, again, if you're just getting a dataset, then there's no point writing the code to send it a bit at a time, so you can do proper progress, so just do a dummy one.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi,
i'm having a silly problem and i'm trying to describe it as simple as possible
i'm accessing a device which takes images. this device has a timeout property, which i have to set high (for some seconds). if a timeout occurs, it is "catched". after an image is taken, it is shown in my gui window.
so, i put the device accessing part in a thread which is getting the images and sending the images to the gui. in code it looks like this:
public delegate void newimg_handler(object sender, newimage_args e);
public class camerathread
{
public event newimg_handler newimg;
bool quitthread;
imageobject img;
public camerathread()
{
img = new imageobject();
quitthread = false;
OpenImageDevice();
}
public void exithread()
{
quitthread = true;
}
public void run()
{
while (!quitthread)
{
try
{
GetImage(out img);
if(newimg != null)
{
newimage_args nia = new newimage_args();
nia.img = img;
newimg(this, nia);
}
}
catch
{
}
}
}
}
public class newimage_args : EventArgs
{
public imageobject img;
public newimage_args()
{
}
}
and in the main form it's called like this:
public Form1()
{
...
ct = new camerathread();
ct.newimg += new newimg_handler(ct_newimg);
camerawork = new System.Threading.Thread(new System.Threading.ThreadStart(ct.run));
camerawork.Priority = System.Threading.ThreadPriority.AboveNormal;
camerawork.Start();
...
}
void ct_newimg(object sender, newimage_args e)
{
img = e.img;
display(img);
}
my BIG problem is, that the gui form is not responding while the thread is waiting for an image from the device (it can be many seconds, according to the timeout property). but why? i wrote the same application in c++ and everything is working fine (but c++ is at the moment not an option, the application has to be in c#.net). i also tried asynchron BeginInvoke calls on a method which is taking the images, but the same result. it looks like it's working sequentially, like i would use a timer for getting the images.
how can i make the thread completely independent working from the gui form, so i can also interact with the gui? i'm confused about the threading under .net. any hint is welcome. help
regards,
criss
|
|
|
|
|
Explain to us what makes you believe that you're starting a seperate thread ? All I see is a seperate class, which ,being on the same thread, would indeed lock the UI.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi christian,
in the forms constructor i'm having the following lines of code earlier listed, which should start my camerathread (the another/seperate thread) or am i wrong? and if this is not doing what i'm thinking it should do, how should it be?
ct = new camerathread();
ct.newimg += new newimg_handler(ct_newimg);
camerawork = new System.Threading.Thread(new System.Threading.ThreadStart(ct.run));
camerawork.Priority = System.Threading.ThreadPriority.AboveNormal;
camerawork.Start();
criss
|
|
|
|
|
OK, yes, that should work.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
it seems like you have a thread with a priority above normal (hence above the UI
thread) and with a "busy loop" (while !quitthread GetImage). It is not
apparent from the code shown that this loop ever relinquishes the CPU;
if it does not, there is a design error (not a language issue) and I would
suggest you add a Thread.Sleep(100) somewhere, possibly in the else of your
newimg test.
Hope this helps.
|
|
|
|
|
hi luc,
yes correct, but also if i'm not using the priority above normal, it's showing the busy gui. and on my side it's not safe to use a sleep in this infinite loop, because i'm waiting for trigger signals from the device and using the sleep could miss some signals.
i mean, i tried exactly the same in c++ without any sleep, with and without higher priority and it's working nicely. so what's the difference between c++'s and .net's threading?
criss
|
|
|
|
|
Hi Criss,
I know of no major difference between the threading model available in .NET and
the one in C++; they both are built on top of the Windows kernel capabilities.
The scheduler's behavior varies from one Windows version to the next;
the theoretical "highest ready process gets all, highest ready thread gets all"
is not followed, Microsoft has decided long time ago to reserve some CPU cycles
to the lower-priority ready processes/threads (but not enough to keep your
UI really responsive !). Nevertheless it is a bad idea to have a busy thread,
i.e. a thread that loops without explicitly relinquishing the CPU (as with a
Thread.Sleep or some semaphore wait or something).
So if you claim you have two implementations (C# and C++) that, running on the
same machine, behave quite differently, I am puzzled, that is the only
explanation I can offer is you have a bug somewhere.
I am worried about your "not missing some signals": you cannot prevent a Windows PC
from focusing on something else (networking, floppy/CD access, whatever).
To be safe, you should have full handshake (in my opinion that means the
"4 arrow" model) for all events you want to be sure to see. The only real
alternative is to have a real-time thread, which definitely is not supposed
to execute infinite loops...
BTW: what is the hardware interface and the comm protocol you are using ?
and what is the OS, and the .NET version ?
|
|
|
|
|
Krzysztof Gorgolewski wrote: and on my side it's not safe to use a sleep in this infinite loop, because i'm waiting for trigger signals from the device and using the sleep could miss some signals.
If the code would be so time critical, then it would not be possible to maintain a GUI at all while it's running, as the thread does not get any CPU cycles while the GUI is being updated.
Try to put a Thread.Sleep(0) in the loop to allow any CPU time at all to go to the GUI thread.
---
single minded; short sighted; long gone;
|
|
|
|
|
the blocking method is the "taking image" (GetImage) method. it's waiting till a signal is triggering the device DIRECTLY. for the device i can setup a "timeout" which i have to set to some seconds. so my problem is not the entire infinite busy loop, it's the GetImage method, which is not returning until it gets a trigger or a timeout occurs. because of this i put it in a seperate thread, to get the gui not blocked.
i'm also confused
btw: i'm using: winxp + .net 2 + usb connected camera device
criss
-- modified at 5:41 Monday 16th April, 2007
|
|
|
|