|
Yeah, it was because of the user. I figured it out though. Thanx for replying.
|
|
|
|
|
Hi.
I've heard somewhere that openCV doesn't develop by Intel anymore ?
Is that true?
Thanks.
|
|
|
|
|
Does this have anything to do with C#?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
well, we can use OpenCV in C#
sorry if the question is out of the subject
|
|
|
|
|
I'm just being lazy, I could look it up for myself, but I have no idea what openCV is.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
It's an open source image recognition package. It was originally developed by Intel, but Wikipedia doesn't say who develops it now
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
It's gone Open Source here on sourceForge[^]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
I am trying to get the contents of a pdf file as text in my C# .net program.
I am using PDFBox 3.0 for reading the pdf as text.
However, the problem is that the pdf file is not physically located on the
same machine and I am accessing it through a URL.
The PDFBox documentation shows that there is a static function which is of the form :
PDDocument load(URL url)
This will load a document from a url.
However, C# does not have a URL class but rather it has a URI class.
Can anybody suggest a workaround.
Or is there any other free tool that would help me achieve reading the pdf file
as text from a URL?
Any help would be appreciated.
Thanks,
Aakar.
|
|
|
|
|
If the method takes a URL, then it must provide a URL class, unless it just takes it as a URI or a string.
What do the docs say ? Are there samples ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
I am dynamically exporting data from asp.net page to excel format which works fine, but when I am exporting a float value 7.0 is being exported as 7 to the excel spread sheet. It is truncating the trailing zero and the decimal point.
Thanks,
vijju
|
|
|
|
|
I assume there is something wrong with your code. Hard to say what, without seeing it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Does a value such as 7.01 also get truncated to 7? If not, and 7.01 shows up as 7.01 in Excel, then this is probably just a case of the default number format in Excel being 'General' which will cause values like 7.0, or 7.00, etc., to show up as 7 in Excel.
|
|
|
|
|
Only values like 7.0 is being exported into excel as 7. if it is a default number formating, then how do you get around it, and just show the value as it is 7.0 in excel.
thanks,
vijju
|
|
|
|
|
That's likely only a formatting issue in Excel. What happens with non-integer values?
|
|
|
|
|
All the values are exported as string. if it is 7.01, it works fine. but if it 7.0, then excel shows it as 7.
Thanks,
vijju
|
|
|
|
|
hi all ,
my query as following
var result = (from page in xmlDoc.Descendants("Page")
from id in page.Descendants("User")
select new
{
Name = page.Element("Name").Value,
ID = id.Element("ID").Value,
View = id.Element("View").Value,
Add = id.Element("Add").Value,
Edit = id.Element("Edit").Value,
Delete = id.Element("Delete").Value,
Grant = id.Element("Grant").Value,
UserID = id.Element("UserID").Value,
LoginID = id.Element("LoginID").Value
}).Distinct().Where(t => t.LoginID.StartsWith(LoginID) && t.Name == Name).ToList();
return result;
above query is working well......but it is case sensitive
i don't know where is problem........
|
|
|
|
|
|
What do you mean "it is case sensitive"? The element names? Thats because XML is case sensitive.
only two letters away from being an asset
|
|
|
|
|
As has been said before, XML is case-sensitive. An icky solution would be to pass it the lower-case string representation of your XML document. You could also iterate through the descendants in xmlDoc, create a new XNode based on each descendant (except with the lower-case name) add them to a new XDocument and work with that for your query.
A side note: look at what you do with your query, particularly the Where() method. You could actually merge that into the query itself, making the code look more aesthetically pleasing. AFAIK, you can do most of what you would normally do with a List, with an IEnumerable
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
|
Wow, I didn't know about that. I've never really looked into XPath queries and functions, I'll have to do that now. Thanks for the tip
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Hello to all. My first thread on this forum. I'm really new with C# and I got stuck with a pointer. I've done some research with no success.
I'm making an application that works with buffers. I have to call some C++ functions with data pointers as arguments. I'm trying to not use unsafe code.
One of the functions have two parameters of type char*. I've defined on C# two buffers:
byte[] Buffer1 = new byte[SIZE];
byte[] Buffer1 = new byte[SIZE];
On the dllimport I use marshaling:
....
[MarshalAs(UnmanagedType.LPArray)] byte[] buffer1,
[MarshalAs(UnmanagedType.LPArray)] byte[] buffer2,
....
These two buffers are filled by the C++ function.
In order to retrieve the data of the buffers, I use another C++ function. This function returns in a parameter the last buffer filled:
void FillBuff(char **Pbuff);
Pbuff is a pointer to one of the byte[] buffers defined above.
The problem is that I don't know how to define a C# to assign the pointer returned by the C++ function and accessing to the buffer's content.
Any suggestion?
Thanks in advance
|
|
|
|
|
Hi,
when mixing managed code and unmanaged/native code, I recommend you let the managed side do the array allocations (so they are real objects); doing so, all you need is one of two things:
1. the fixed keyword, which is OK if the array is used natively only while the native function executes; here the P/Invoke prototype takes a pointer where the native code expects a pointer.
2. the GCHandle class, which allows you to:
- pin the object, so the GC can no longer move it around
- get a pointer to it
- pass that pointer to the native function
- when done, free the GCHandle object.
Here the P/Invoke prototype takes an IntPtr where the native code expects a pointer.
BTW: for strings, there are easy shortcuts:
- read-only strings can be passed as string and accepted as char*
- read/write strings can be passed as StringBuilder (call ToString when done)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks for answering.
They are not strings, are image buffers. I use a ping-pong strategy: One buffer for grabing image, the other for processing it, both alternating. I declare both buffers at the C# application and pass them to the C++ DLL. The image grabbing routine passes back the pointer to the buffer holding the last image grabbed. Is this parameter which I don't know how to declare and manage at the C# level. I'll like to have the pointer accessible everywhere, as I have to draw the image and process it.
C#: Buffer1 and Buffer2 and Pointer to active buffer
C++: Fills Buffer1 and Buffer2 and passes back pointer to last grabbed buffer
Using fixed keyword doesn't wrok for me, as I want to have a "global" variable. About GCHandle, I'm not sure if I'll be able to use it for using the Marshal.Copy:
System.Drawing.Imaging.BitmapData bmpData =
bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite,
bmp.PixelFormat);
// Get the address of the first line.
IntPtr ptr = bmpData.Scan0;
int bytes = bmp.Width * bmp.Height;
// Copy the RGB values back to the bitmap
System.Runtime.InteropServices.Marshal.Copy(PBuffer, 0, ptr, bytes); // TRANSFERING HERE THE CONTENT OF THE GRABBED BUFFER TO THE BITMAP IN ORDER TO PAINT IT
// Unlock the bits.
bmp.UnlockBits(bmpData);
Thanks in advance for helping
|
|
|
|
|
Hi,
when fixed doesn't fit the requirements, GCHandle will. I tend to almost always use GCHandle, even when fixed would suffice. One of the advantages is you typically don't need to copy the data AT ALL, since the scenario is:
1. managed world creates an array
2. uses GCHandle to pin and get the pointer
3. passes it to native world, which fills the buffer, then returns
4. managed world frees GCHandle and uses the array.
See, no copy involved, hence also no performance hit.
If the buffer is really the entire pixel data of a Bitmap, I would try and use Bitmap.Lockbits to pin and get the pointer (it does what GCHandle does for a general object), pass that pointer to the native world, and all would be OK again without a copy operation, provided your native code:
1. applies the right byte ordering within a pixel
2. applies the right pixel ordering
3. applies the right bitmap stride (normally no problem if scanlines are a multiple of 4 bytes, which is true for 32-bit pixels, or image widths that are multiples of 4).
My number 1 rule in image processing is: avoid copy operations.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|