|
i want data flow diagrams for the unicode optical character reconition using neural network project
tulasi
|
|
|
|
|
That's good. I'm so pleased for you, in fact there was a bit of touching cloth there, so pleased was I."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
That's nice. People in Hell want ice water.
What are the chances we're going to supply either?
Seriously, showing up in any forum and demanding people hand over their hard work to you so you don't have to do it yourself makes you look like a steaming pile of elephant dung. If you get fired over this or fail a class, so be it. You deserve as much.
|
|
|
|
|
Hi everyone. I'm wondering about this and I can't find the answer anywhere: I know in an instance method arg_0 contains the instance the method was called on -- but what (if anything) does it contain in a static method? Would it be the type of the class the method belongs to?
(When I say arg_0 I'm of course talking about MSIL (aka CIL), the intermediate language into which C# gets compiled. Arg_0 is the implicit argument, i.e., this in an instance method. What about static methods?)
Thanks. modified on Friday, February 19, 2010 7:48 AM
|
|
|
|
|
Great, I'm an idiot. I just found it: in a static method it contains the first argument (a non-implicit argument), if any.
For example:
void instanceMethod(int intArg, float floatArg) {
}
static void staticMethod(int intArg, float floatArg) {
}
In instanceMethod :
* arg_0 = this
* arg_1 = intArg
* arg_2 = floatArg
In staticMethod :
* arg_0 = intArg
* arg_1 = floatArg
I'd delete this post, but I'll leave it up in case anyone has the same question.
Here's where I got the answer. There's a lot of useful info on Reflection.Emit.
|
|
|
|
|
Good day.
In my app have ListBox and i items draged.How to know Drag&Drop to Windows Explorer ?
My draged items size will be very big , like 4,5 GB, so i can't use MemoryStream.
Please help me.
Thanks .We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Hello Friends,
i want to get the client browser time on server side. I am developing an application in C# and i want to display some alerts according to client machine time. So please let me know if there is any way in which i can get it on server side code.
Thanks
Sher Azam
|
|
|
|
|
Read the client time using javascript, put it in a hidden field, post the form.
|
|
|
|
|
Thanks for your reply.
can you please provide me sample code for it?
actually i try this method but when i get the hidden field on server side it came empty.
a sample code will be very helpful for me.
|
|
|
|
|
|
Hey guys, I'm trying to create a regular expression which matches text with html links in it. I want to extract both the URL and the 'clickable' text. The regular expression so far :
(<a(.)*href=("|')(?<url>(.)*)("|')(.)*>(?<text>(.)+)</a>)
Now in general, this works. When I enter a text with a html link in it :
blah blah blah <a href="/link.aspx" target="_blank">clickable text</a> blah blah
The regular expression returns one match containing <a href... ... </a> so that works fine...
However, when I enter a text that contains two links :
blah blah blah <a href="/link.aspx" target="_blank">clickable text</a> blah blah blah blah blah <a href="/link.aspx" target="_blank">clickable text</a> blah blah
The regular expression still returns one match, containing the first <a href... till the second </a> which is not the wanted result. I want the regular expression to return two matches. Can anyone help me?
Regex regx = new Regex("<a(.)*href=(\"|')(?<url>(.)*)(\"|')(.)*>(?<text>(.)+)</a>", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled);
MatchCollection col = regx.Matches(Input);
|
|
|
|
|
Try this tool, Expresso[^]. It has a library of regex and testing environment that may help I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I am familiar with Expresso, which by the way returns the same result. Expresso also returns only one match containing the tag opening of the first link, untill the closure of the second link. I want two matches with both links
Thanks for the help anyway
|
|
|
|
|
I think your problem is that . is greedy. You should make it lazy with ? . (Reference[^])
This <a(.)*?href=(\"|')(?<url>(.)*?)(\"|')(.)*?>(?<text>(.)+?)</a> should work. Although it is untested.
Lazy lookup is less efficient than regular lookup so you may want to use something more appropriate like (?<url>[^'"]*) .
I have found http://www.regular-expressions.info/[^] to be a great resource.
|
|
|
|
|
Wow, works flawless! You for presedent!!
Thanks !
|
|
|
|
|
Hi everyone.
I'm creating a class through reflection and I'd like to have a static initializer like this:
class MyClass {
static MyClass() {
someMethod(typeof(MyClass));
}
}
That is, I'd like to obtain the type of MyClass and pass it to someMethod as argument. What's giving me trouble is obtaining the type of MyClass , since I'm emitting this code before the type MyClass is created: I'm defining MyClass with a TypeBuilder , but I haven't called CreateType() yet because I first need to add the static initializer. I have a hen-and-egg situation here.
Ideally what I'd like is to do something like:
class MyClass {
static MyClass() {
someMethod(this.GetType());
}
}
but of course not with this because I'm in a static member and there's no "this". So, is there something equivalent to this but that identifies the class (or type) in which the code is declared (i.e., to which class belongs the code that is being run)? Sorry if I don't make much sense, I'm having trouble expressing this clearly
Thanks!modified on Friday, February 19, 2010 8:35 AM
|
|
|
|
|
blackblizzard wrote: someMethod(this.GetType());
Try this.
someMethod(typeof(MyClass)); Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
No, sorry, the problem is I'm emitting the code with Reflection.Emit, so I can't just type "MyClass".
It works like this:
* Someone calls my class ObjectFactory with a Type they want me to extend, say "MyType".
* Using reflection, I create a subclass of MyType, called EXT_MyType, which has some extra fields and methods. I want to add a static initializer to EXT_MyType, which should look like this:
static EXT_MyType() {
someMethod(typeof(EXT_MyType));
}
But the problem is when I emit the code for this static initializer I haven't yet created the type EXT_MyType (that's what I'm doing, I'm creating its static initializer, etc), so I don't know how to emit this code. See, I'm trying to emit it like this:
ilGenerator.Emit(OpCodes.Ldtoken, typeof(EXT_MyType));
ilGenerator.Emit(OpCodes.Call, typeof(EXT_MyType).GetMethod("someMethod"));
but EXT_MyType doesn't exist yet. So I'm wondering whether there's a primitive or something I can invoke from within the static initializer that will allow me to do this instead:
static EXT_MyType() {
someMethod(getTypeOfThisClass());
}
Where getTypeOfThisClass() would be that "primitive or something...". Since this call would take place once I've created EXT_MyType there wouldn't be a problem. I just don't know whether a primitive like that exists.
If it doesn't, I'd appreciate suggestions on alternative ways of doing this.
Thanks!
|
|
|
|
|
There's no such primitive. You'll have to emit a typeof(EXT_MyType).
This doesn't mean that typeof(EXT_MyType) has to appear in your code - you can get the System.Type instance in other ways using the Reflection API.
In fact, I think you already are using that System.Type instance: System.Reflection.Emit.TypeBuilder derives from System.Type.
So you should be able to use:
ilGenerator.Emit(OpCodes.Ldtoken, myTypeBuilder);
|
|
|
|
|
Yeah, thanks, I think that's it. I had actually found a solution:
ilGenerator.Emit(OpCodes.Ldtoken, classInitializer.DeclaringType);
but of course yours is better, since there's no point doing it like that when I already have the type builder. It was a newbie question
Thanks!
(I was going to post my own solution but I'm still having some (hopefully unrelated) issues, so I was waiting to see if it really did solve the problem; I'll mark the thread as solved, though)
EDIT: It worked! Thanks
|
|
|
|
|
Hi experts
i am working with winform using C#.NET
Can you Help Me that if i am Create ADO.NET Connection
like
using(SqlConnection ICon=new new SqlConnection()
{
ICon.Open();
}
if i am using this connection in 100 form then i have every time open that connection in every form or any other way to manage this.
dinesh
|
|
|
|
|
Sharma Dinesh Kumar wrote: if i am using this connection in 100 form then i have every time open that connection in every form or any other way to manage this.
..or you create a small method that gives you an new and open connection;
SqlConnection GimmeConnection()
{
SqlConnection con = new SqlConnection(connectionString);
con.Open;
return con;
} ..used like this;
Using (SqlConnection = GimmeConnection)
{
} I are Troll
|
|
|
|
|
Hi everyone.
I'm having trouble with the following: I need a way to distinguish the different fields of a class by means of integers -- for example, given the following class:
class MyClass {<br />
<br />
float floatField;<br />
double[] arrayField;<br />
Object objectField;<br />
<br />
}
I'd like to be able to identify floatField as field 0, arrayField as field 1, and objectField as field 2. I don't really care about the order, but I need the integers to be consecutive and to never change throughout execution. They can change between executions.
I haven't seen any straightforward method for this in Type . The best I can come up with is to call typeof(MyClass).GetFields() and use the order the fields in the return array as their id. For example, if it returns [floatField, arrayField, objectField] , it would return in the ids I mentioned above (0, 1 and 2, respectively).
I'm going to need to find the id of a given field pretty often throughout execution, so I create a dictionary that maps the name of a field to its index, like so:
int i = 0;
Dictionary<string, int> fieldOffsetDict = new Dictionary<string, int>();
foreach (FieldInfo field in typeof(MyClass).GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public)) {
fieldOffsetDict[field.Name] = i++;
}
Anyone can think of a better way of doing this (for example, is there a method that I've failed to see that would do this directly), or do I keep it as it is? I can't help but feel this is a bit of an overkill, so I'd like to make sure.
Also, if I didn't mind the ids not being consecutive, would there be a better way to do this?
Thanks.
|
|
|
|
|
Hi,
if you want a free choice for the field names, and need name->ID mapping, the dictionary seems best; for a simple ID->name mapping, a List would suffice.
if you don't really care about field names, then why not name them consecutively, hence:
class MyClass {
float f0;
double[] f1;
Object f2;
}
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Thanks for the confirmation.
I do care about field names, just not about their order. The code still needs to be legible
|
|
|
|