|
You only match one digit for the date, but you need to match one or two.
The set [0-3000] will not be recognised as a range of numbers, it will be a set of the digits 0-3, 0, 0 and 0.
You only match one digit for hours, but you need two.
You only match one digit for minutes, but you need two.
You only match AM times, but PM times will fail.
Sets containing one one character is superflous. [A] is the same as plain A.
---
single minded; short sighted; long gone;
|
|
|
|
|
ya he is correct in addition you r calculating single space onlyso \s* has to be gven
with regards
Balagurunathan.B
|
|
|
|
|
Hello Guffa
Thanks for your help back then.
I am trying to index with his regex but it does not pick text that's stored in a HTML tag.
Example: Johnson <b>Peter</b> Smith for the keywords "John" and "Peter" returns only "John"
\\b("+keyword+"'?s?)\\b|(^"+keyword+"'?s?)\\b|\\b("+keyword+"'?s?$)
So how do I go about making the regex pick-up Peter, which is in a HTML tag. Thanks
Anthony, Canada.
|
|
|
|
|
On the contrary. It finds "Peter", but not "John".
Do you have an example that actually does demonstrate what you are trying to do?
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks!
For example, i want to search for James, but because the James in my text is embedded in a BOLD tag, it does not return a result.
So if I have <b>James</b> is there a way I can "remove" the HTML tag, and have only "James" for my regex to pick-up?
|
|
|
|
|
ant1xxx wrote: For example, i want to search for James, but because the James in my text is embedded in a BOLD tag, it does not return a result.
Yes, it does.
ant1xxx wrote: So if I have James is there a way I can "remove" the HTML tag, and have only "James" for my regex to pick-up?
You don't have to. It's matching only "James", not the html tags.
---
single minded; short sighted; long gone;
|
|
|
|
|
We have a main method which calls a sub method 50 times and in turn the sub method calls one more method 5 times. From the first the datatable is passed by byval and one or two value types are passed by byval. The method doesn't make any changes to the variables
1. Byval or Byref - which will be faster-multiple times and multilevels calling?
2. Will that be a good idea to have multiple levels of methods to be called multiple times. We have lot of local variables. Will the garbage collectors's headache be more in creating and destroying the objects?
Thanks
|
|
|
|
|
ByVal means that the method will create its own copy of the variable, and any changes will not be passed back to the method that called it.
ByRef means the method will use the variable you passed in and update it.
Some objects (I believe DataTables are one example of this) are always passed ByRef even if you specify ByVal because they are so complex.
It sounds like what you want to do is use ByRef. Running a method that updates a couple variables 50 * 5 = 250 times shouldn't be too much for an average computer today. If you were updating several hundreds of thousands than you may worry about it more.
Hope this helps.
|
|
|
|
|
thank you i never fully got that. i even goggled it before and never saw good answer.
|
|
|
|
|
First: abandon any notion of ByRef vs. ByVal from VB6.
Second: there is a difference with ByVal and ByRef wrt object instances.
What ByRef and ByVal indicate are which memory address to copy to the method's stack.
Lets look at the following code:
<br />
Private Sub DataTableCreator()<br />
Dim dt As New DataTable()<br />
ByValReceiver(dt)<br />
ByRefReceiver(dt)<br />
End Sub<br />
<br />
Private Sub ByValReceiver(ByVal valdt As DataTable)<br />
valdt = Nothing<br />
End Sub<br />
<br />
Private Sub ByRefReceiver(ByRef refdt As DataTable)<br />
refdt = Nothing<br />
End Sub<br />
ByValReceiver will take in the memory address of the object on the heap and assign it to a local variable "valdt" on it's stack.
ByRefReceiver will take in the memory address of the variable "dt" from DataTableCreator's stack and assign that to refdt.
So what does this do for you? Two things.
1) If you run the code you'll see ByValReceiver won't effect dt in DataTableCreator, but ByRefReceiver does.
When you assign Nothing you're in effect clearing the memory reference from the variable.
refdt is really a reference to a reference (or pointer to a pointer in in the old days **p), setting it to nothing clears the real reference to the DataTable, which is dt in DataTableCreator.
2) I can't prove this since .Net can be a black box, but I fully expect that nesting calls with ByRef will cause multiple dereferencing steps (going to the memory address in the variable) to get back to the heap.
If you used refdt, first it must dereference to dt, then dereference dt to get to the actual DataTable instance on the heap.
This would actually marginally slow things down.
ByRef is required for when you want value types, which are held on the local stack (i.e. integer, long, structures etc) to be modified by the called method.
Think out parameters.
Objects should be handed down ByVal, unless you really want to use the trick above!
Hope this clears things up at least a little?
Coding since '85 - ATARI BASIC, Forth, C, Java, C#, VB.Net ..
|
|
|
|
|
K.P.Kannan wrote: The method doesn't make any changes to the variables
Then you should not pass anything by reference.
K.P.Kannan wrote: Byval or Byref - which will be faster-multiple times and multilevels calling?
ByVal will be faster, and that is the default way of passing parameters.
When you pass an object by value, you are passing a copy of the reference to the object, and it will be handled just as afficiently as a local variable in the method.
When you pass an object by reference, you are passing a reference to the reference to the object. Whenever you use it in the method, it has to be dereferenced, which adds a small overhead each time.
The ByVal and ByRef keywords are mostly kept for compatibility reasons. In object oriented programming they are very rarely used at all.
K.P.Kannan wrote: Will that be a good idea to have multiple levels of methods to be called multiple times.
Unless you are making a huge number of calls to the methods, it doesn't matter much.
K.P.Kannan wrote: We have lot of local variables. Will the garbage collectors's headache be more in creating and destroying the objects?
Local variables are allocated on the stack, and don't have to be garbage collected at all. If you have local variables that are references, and create objects for those references, the objects will of course be garbage collected.
Creating and freeing objects are considerably cheaper in .NET than it was in VB6. As long as you make use of the objects, you should not normally be concerned with the cost of creating and freeing them. If you create and free the same kind of objects a lot, you might consider a way of reusing them, but on the other hand many objects are not even built to be reused in that way.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you all for the explanations. It was nice and explained a lot
|
|
|
|
|
hi,
I need to make an error handling for a program but I don't know how should I start.
If you have any idee please let me know.
thanks.
|
|
|
|
|
Try this[^]
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
hi,
i m developing a ftp in vb.net,it is connecting to server and when
using ftpfindfirstfile it is returing some value.but the problem is with
Structure WIN32_FIND_DATA cfilename it is fixed string in vb but how convert
this in to vb.net,
if anyone provide wininet api it will be great help
tx
|
|
|
|
|
You can find a bunch of stuff at Pivoke.net. Like this[^]
|
|
|
|
|
|
In that site there is only for vb but not for vb.net.
can any one provied some code for wininet for vb.net
|
|
|
|
|
BS. That link goes directly to code for VB.NET, NOT for VB6. PInvoke.net doesn't support VB6 code at all.
|
|
|
|
|
|
Solution 1:
Try setting the WebBrowserShortcutsEnabled to false. This stops my control from doing anything on Ctrl+P, however the program I checked it in had a keypress handler on the form itself.
Solution 2:
Handle the webbrowser's KeyUp event:
If e.KeyCode = Keys.P Then<br />
If e.Control Then<br />
' do nothing with this.<br />
e.Handled = True<br />
End If<br />
End If
It ought to be that setting e.Handled as true will stop the control from doing anything when Ctrl+P is pressed.
BTW it needs to be KeyUp because KeyPress has no easily accessible value (and is a pain).
Yet another spam post on yet another forum!
I am the lazy one, who sleeps as it suits him, codes what he wishes, and has many years to look forward to.
I love being a student.
|
|
|
|
|
Hello Ninja,
thankx a lot...it helps me much
-koolprasad2003
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
i wan to do one crystal report by takin combination.
the report should look like this.
sl.No Caste of student no of students fees paid
caste n no of students v r takin from admission table.
amount paid from feereceipt table.
caste should be distinct n no of students should be respectable to that.
We used this query
SELECT a.CasteOFStu AS Category, (select count(*) from admission) AS NoOfStudents, (Select Sum(FeesReceiptDetails.amount) from FeesReceiptDetails,FeesReceipt where FeesReceipt.ReceiptNo=FeesReceiptDetails.REceiptNo) AS TotalAmount
FROM Admission AS a, FeesReceipt AS b
GROUP BY a.CasteOFStu;
but its givin total no means over all no of students irrespective of caste.
can u give me any fair idea of any query which has solution to above problem r any other crystal report functionality to help us in this condition.
thank u....
|
|
|
|
|
First, please don't type in SMS language. Its ugly.
Second, you are not making any connection between admission table and your feereceipt table in your query.
----------------------------
**** JOB23743 Submitted ****
|
|
|
|
|
STOP naming your messages Help! or Urgent! You have been here long enough to have had time to read the forum rules.
__________________
Bob is my homeboy.
|
|
|
|