|
Makes perfect sense. This actually helps open up some other doors that explain a few other things. Muchas gracias.
- Mike
-------------------------
"No human being would stack books like that." - Dr. Venkman
|
|
|
|
|
How can I read the bitmap file pixel by pixel? I need some code.
|
|
|
|
|
Load the file into a Bitmap object and call its GetPixel method.
Bitmap myBitmap = new Bitmap("Grapes.jpg");
Color pixelColor = myBitmap.GetPixel(50, 50);
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
|
Hi all
I have currently learning to program in C#. I am inspired by the A* path-finding C# algorithms written by Eric Marchesin.
I like to seek help on the implementation of Potential Field Method for robot navigation.
Can anyone show how the complex objects( such as goal, robot, multi-shaped obstacles) can be created systematically ? I am really at a lost.
Other challenges include solving local minima problem and intelligent navigation.
Anyone who has the expertise.Please your help is very much appreciated.
|
|
|
|
|
sodium wrote:
Can anyone show how the complex objects( such as goal, robot, multi-shaped obstacles) can be created systematically ?
What do you mean by "systematically"?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
methodically would be a better description. Dave, are you capable ?
|
|
|
|
|
Nope. Never touched Navigation algorithms...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
I am having a problem with xsd convertion to csv file. The code below describes how I attempted to approach the problem. The code works but the output is not properly format.
ObjBISReports As DsReports (a type dataset)
.. after the dataset has been filled using sqldatadapter
ObjBISReports.WriteXml("C:\Tunde.xml", XmlWriteMode.IgnoreSchema)
Dim xslt As New XslTransform()
xslt.Load("F:\Alliance International\Projects\AIA Database Application\Application2\Components\GetOutStanding.xslt")
Dim doc As New XmlDocument()
doc.Load("C:\Tunde.xml")
'Create an XmlTextWriter which outputs to a file.
Dim fileName As String = "C:\tunde.csv"
Dim writer As XmlWriter = New XmlTextWriter(fileName, Nothing)
'Transform the data and send the output to the console.
xslt.Transform(doc, Nothing, writer)
writer.Close()
This is the stylesheet format:
"<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="DsReports">
<xsl:apply-templates select="GetOutStandingBills"/>
</xsl:template>
<xsl:template match="GetOutStandingBills">
<xsl:for-each select="*">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:value-of select="','"/>
</xsl:if>
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>"
Please if anyone knows a much effective means of converting xsd to csv or excel could you let me know.
Thank You
Tunde Olawuwo
|
|
|
|
|
Notice you're using VB.NET - this belongs in the VB.NET forum. But since it really has more to do with the XSLT, the answer is simple: you must set the xsl:output method (assuming xsl is your namespace prefix for the XSL Transform namespace) so that the method attribute is just text . Then you must make sure that a new line is output after the last element in the CSV. A simple way is to output a CR-LF pair like so:
<xsl:text disable-text-escaping="yes"> </xsl:text>
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
oops sorry for posting vb question in a C# region. Thanks I appreciate it!
|
|
|
|
|
How can I recognize the characters in a bitmap using c#?
(Im doning OCR prgram)
|
|
|
|
|
You could Google for 'OCR' algorithms. There is one here[^] on CodeProject.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
XmlTextReader reader = new XmlTextReader ("faq.xml");
Why is the default directory for this code = c:\winnt\system32? Maybe I'm missing something, but since this code is located inside of a ASP.Net Default.aspx file... shouldn't it default to the web root?
|
|
|
|
|
No it shouldn't. It has to do with the executable path or the current working directory set by the executable.
To open a file in a virtual directory, you should use the MapPath method, which is available both on the intrinsic Server property of several objects (an instance of HttpServerUtility ) or on the Page class itself:
string path = MapPath("faq.xml");
XmlTextReader reader = null;
try
{
reader = new XmlTextReader(path);
}
finally
{
if (reader != null) reader.Close();
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the tip. Do you have any suggetions (websites) for a beginners guide to updating XML files in C#?
|
|
|
|
|
|
I'm trying to find the top of a cell in excel.
i tried this code in vba:
something = OutputWorksheet.Range("A1","A1").Top
this works fine
the only way i've found of getting c# to do the same is:
float something = (float)Convert.ToDouble( OutputWorksheet.get_Range("A1","A1").Top.ToString())
is this really the way i have to do this cast?
Thanks
Russell
|
|
|
|
|
Um, why convert to a Double and then cast to a Single (float )? Also, get_Range returns a Range object, from which you can get the Top and just cast that to a float like so:
Range rng = OutputWorksheet.get_Range("A1", "A1");
float top = (foat)rng.Top;
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi everyone,
I have an application that should support two types of databases (SQL Server and Oracle). What I want to do is create a datalayer that will use SqlConnection or OracleConnection object depending on the database.
In C++ I would have done the following:
template<class ConnectionType>
class DataLayer
{
...
...
ConnectionType * type
}
DataLayer<SqlConnection> m_layer; // for example
How can I achieve the same result in C#?
Thanks,
Sincerely,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
You would use the provider pattern, an abstract class or interface that contains the methods you would invoke. You then use the appropriate implementation (SQL, Oracle, whatever) that you could configure in the application's .config file. We've been using this since .NET 1.0 for our smart client application.
.NET 2.0 will use the provider pattern heavily: for database access, authentication, personalization, and much, much more.
For more information, you should read a couple of recent MSDN articles:
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath!
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hi. I need 3 applications working at the same time. The first one is a
Pocket PC application, the second is a web service and the third one isn't
done yet. This third app is only to receive messages (maybe a Windows Forms
application or even an ASP.NET one...)
The question is how to send messages to the third application. It should be
the web service when the Pocket PC calls a web method. How could I do that?
Remoting? I only need to send a string, so the easier method
Regards,
Diego F.
|
|
|
|
|
.NET Remoting is probably the easiest way. The PPC (presumably a .NET CF application) would call the web service method, which calls a remoting method on the third application. It should be tollerant that the third application might not be running, especially if this is an application that must be started by the user (like a desktop application monitor or something).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
OK, then I'll try with Remoting. Is there any consideration I should know using Remoting with web services or is just the same way as using Remoting between two console applications?
Regards,
Diego F.
|
|
|
|