|
jayantbramhankar wrote: matrika is two dimesional
No it isn't.
modified on Friday, March 19, 2010 3:41 PM
|
|
|
|
|
int[,] matrika = new int[x, y];
It's not? Granted, there is no word "dimesional", but it seems 2D to me.
|
|
|
|
|
Sorry, I didn't see the lowercase m.
|
|
|
|
|
So, how do i make it member of class, that will conatain x=5 and y=5 in this case.
"polzisce" has to be object wich contains a 2d array wich is specified with this Matrika polzisce = new Matrika(5,5);
Tnx for your answers ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
I'm still not sure what you want, but how about this:
public class Matrika
{
private readonly int x ;
private readonly int y ;
public Matrika
(
int X
,
int Y
)
{
this.x = X ;
this.y = Y ;
return ;
}
public int[,]
GetArray
(
)
{
return ( new int [ this.x , this.y ] ) ;
}
}
Matrika m = new Matrika ( 5 , 5 ) ;
int[,] polzisce = m.GetArray() ;
|
|
|
|
|
Hello,
I already use a graphic library (named Irrlicht) with a C# package called Irrlicht.NET (with a file Irrlicht.NET.dll and Irrlicht.NET.xml)
The libary is open source, and has recently delivered a new release.
But the .NET package has not been released (done probably by an other team)
How can I build the new release for C# .net ?
Best regards.
|
|
|
|
|
pedefetoll wrote: How can I build the new release for C# .net
How do you build the C++ code base to use with C#? Or, how do you get the C# source and build it? Did you ask the Irrlicht developer team?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
The C++ code with project files is full available on following site :
(see at http://irrlicht.sourceforge.net/downloads.html)
But I don't know how to convert documented C++ API for managed application (like MS C#).
Best regards
|
|
|
|
|
pedefetoll wrote: convert documented
Ah. You do not want to do that. What you would have to do is to go through the source line by line and translate it to its C# equivalent. Probably a big task. I think that what you really want to do is to take the C++ DLL and use it in your C# project. The keyword you are looking for is P/Invoke. Plenty of articles around that show you how to do that.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Hi All,
I have two C# windows application, both are reading .csv file and doing some processing, however there is one difference between both .csv file. One .csv file is using comma (,) as delimiter (separater) and other .csv file is using |(Pipe) character as delimiter (separater), so basically that is customized seperater.
Both .csv file is used by my two different C# windows application.
Now here is a problem.
My first application used .csv file which has comma(,) as seperater and i am using provider as "Microsoft.Jet.OLEDB.4.0" to reading that file with following connectionstring:
string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + csvfile.Directory.FullName + ";Extended Properties='text;HDR=Yes'";
As by default it's comma, so i don't have to do any changes in my registry to read this file, it's simple but problem came when i am using my other C# windows application.
Second C# windows application is using other .csv file which has |(Pipe) character as seperater(delimiter). To read this type of .csv file i used following connection string
string textConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"" + StrInputCSVFile + "\";Extended Properties='text;HDR=No;FMT=Delimited';";
As well as in the registry i specified (|) delimiter at following place:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Jet \ 4.0 \ Engines \ Text
i defined "Format" = "Delimited(|)" and second C# application able to read .csv file in correct way but now the problem is that it screwed up my first C# application as it is using comma as seperater.
Is there a way to define multiple custom delimiter under registry setting at following place
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Jet \ 4.0 \ Engines \ Text
like Delimited("|",",") etc or some thing like that??
I tried that but it didn't work.
My questions are :
- how can my both C# application should work without effecting each other?
As i said , one is having comma(,) as sepearter(delimiter) in .csv file and other is having (|) pipe as sepearter, how can my two different application can work at it's own without effecting each other?
- Currently as i defined delimited(|) in above mentioned registry setting so it screwed up first application and my first application is NOT able to read .csv file (which has comma(,) as delimiter)
- Is there a way to define Multiple delimiter in registry settings at above mentioned location at registry?
I don't want to use scheme.ini file at all.
Pls. help me out to resolve this issue.
Thanks in advance.
|
|
|
|
|
montu3377 wrote: delimiter under registry
Do you have to use the registry? There are easier/better ways to accomplish this other than using a registry setting.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Hi,
Can you tell me what are easier ways? I am using following code :
//Taking connection using to .csv file
string textConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"" + StrInputCSVFile + "\";Extended Properties='text;HDR=No;FMT=Delimited';";
//assigning to oledbconnection string
OleDbConnection conn = new OleDbConnection(textConnectionString);
// Opening connection
conn.Open();
//selecting rows from .csv file
sql_select = "Select * from " + InputCSVFile.ToString().Trim() ;
//Creates the data adapter
OleDbDataAdapter obj_oledb_da = new OleDbDataAdapter(sql_select, conn);
//Fills dataset with the records from CSV file
obj_oledb_da.Fill(ds);
As i have (|) pipe character in my .csv file , so i am specifying (|) pipe sepearter in registry setting otherwise i will NOT get correct parsed values.
Pls. let me know if you have some other way rather than this way??
I am eager to seeing that.
Thanks a lot for reply.
|
|
|
|
|
montu3377 wrote: way rather than this way
Take a look at this article, A Fast CSV Reader[^] and see if that is fills your need. You can use whatever delimiter you want.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Is to use different extensions for your file types to determine whether a pipe or a comma is used as the delimiter.
|
|
|
|
|
I don't think I've ever heard of anyone using the Jet engine to read a CSV file.
Most people just read and Split the lines.
|
|
|
|
|
Using Jet (or ACE) is pretty useful because you can use the ADO.Net classes to work with the data instead of manually parsing. It's especially useful for more complex CSVs that have "Excel-friendly" fields similar to
"=""Value""""WithQuotes"""
|
|
|
|
|
If you want to continue using the Jet engine to read in your pipe delimited file then you are going to have to use a schema.ini file as the registry can only be use for a single delimiter value or, use the article Wes linked to and drop using the Jet engine.
|
|
|
|
|
i have created an object at client side and update it some properties values and pass it to the server, to save the object data in database.
Object data is saving correctly and the some properties is also updating at server side of passing object. but when we access the object at client side
then client properties does not update.
so how can we work as reference object between client and server in remoting, means if we update the object properties at server side, then it should show the changes at client side also?
|
|
|
|
|
The only way to do this is to transmit the changes back again. As you are aware, your changes have been made in a separate app process, so they aren't visible. Possibly the "easiest" way to do this would be to raise an event at the server side, which returns the changes to the client.
Search for .net remoting events to find some articles on this because it's not as simple as just coding an eventhandler. Remote events need marshalling too, so you'll need to get a thorough understanding to accomplish this.
BTW - this is also known as a callback.
"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
|
|
|
|
|
Hi, I'm a newbie in drawing using C#.
I want to create a filled cylinder or a tube.
So what I do is I created a closed curve using 4 points (using FillClosedCurve) with 0.8f tension. Then I translated the same closed curve vertically to create a sense of height. But then how do I fill the sides?
Here is an image to illustrate my explanation: http://img692.imageshack.us/img692/9461/100319codeprojectquesti.png[^]
Thanks for any help.
|
|
|
|
|
Valeriant wrote: But then how do I fill the sides?
Fill it by drawing vertical lines, from the left side of the picture. Get a point on the top circle, find the corresponding point on the other circle, and draw a line. You can make the color lighter or darker as you move forward with drawing lines, creating a gradient.
I are Troll
|
|
|
|
|
You mean drawing vertical lines following the path of the curve? How do I get the point from the path? I used only four points (p1 to p4) to create the closed curve. Isn't this solution will make painting slower?
|
|
|
|
|
Yeah, it makes painting much slower and you cannot have the points on the curve returned to you to use, so you have to make something else up.
Seriously, GDI doesn't know anything about 3D. I highly suggest moving on to WPF, OpenGL or XNA instead.
|
|
|
|
|
Valeriant wrote: How do I get the point from the path?
You can calculate it's position, or move to the black pixel that lies on the right side of the current pixel (one higher or lower, perhaps).
Valeriant wrote: Isn't this solution will make painting slower?
Slower, compared to what?
I are Troll
|
|
|
|
|
Eddy Vluggen wrote: You can calculate it's position, or move to the black pixel that lies on the right side of the current pixel (one higher or lower, perhaps).
How do I calculate the position? How do I move to the black pixel? Can you give an example in C#?
Eddy Vluggen wrote: Slower, compared to what?
Slower because it paints n lines compare to just filling a region?
I can draw the ellipse repeatedly while changing the location each draw (height and slant) to create a fill effect, easier to code but slowing the overall painting (I could have lots of cylinder to draw).
I kinda have a feeling that the solution might be a mathematical calculation (with tan, cos or sin), but I really don't have any idea. If I know the outer most point and the correct tension for using, maybe, AddCurve() in GraphicsPath, I could then fill the cylinder's side, right? That's what I think, but any other solution is welcome.
|
|
|
|