|
Hi
no, i don't want to use any third party controls, i want to create my own.
can u help me ?
|
|
|
|
|
Hi Friends,
I am working on a ERP windows Project c#, that should support both Oracle & Sql Server. Now I suppose to write procedures for both the databases. because we don't want inline queries in our codes. I feel this will cause maintanance issue in future as software size grows.
I heard, Entity Framework & Linq to DB will affect application performance when compare to stored Procedures.
Please advise me, what is the best solution. That should solve performance as well as SQL & Oracle support.
Thanks in Advance
Anand
|
|
|
|
|
The application should neither know nor care what database is in use. This is where the Data Access Layer shines -- it separates the application from the database. I prefer to have a database-agnostic framework (such as my DatabaseAccessor[^]) upon which to build the DAL. You can then build flexibility into your DAL to deal with the various flavors of SQL (which is a step I haven't bothered to take yet myself).
Given a proper DAL, the application developers won't know whether you are using stored procedures or not.
anand kumar m wrote: Now I suppose to write procedures for both the databases. ... I feel this will cause maintanance issue in future as software size grows.
Yes, it will. The queries have to go somewhere, and there are differences in how SQL is implemented by various vendors. For ease of maintenance, the multiple versions of a particular query should be kept close together, in one file if possible. This tends not to be the case when using stored procedures. It's one of the things I like least about stored procedures (I don't use stored procedures anymore).
anand kumar m wrote: Entity Framework & Linq to DB
Don't those only work with SQL Server? Either way, I avoid them.
The old ways are the best ways.
P.S. As to performance -- you still need to write good SQL and use Connections, Commands, and Parameters effectively.
Most "performance" problems are caused by poor understanding of the tools being used.
modified on Saturday, April 24, 2010 1:18 PM
|
|
|
|
|
hi bloggers,
I have been trying to visualize my gestures through MS chart graph, for instance using wiimote accelerometer to draw a shape of the number(0-9), when I try to make 0,6,8,9 the shape is not drawn completely rather the coordinates spreads on the other side.... currently Im calculating velocity and distance from the accelerometer values(x,y,z) and then plot distance values to MSCHART spline graph....
give me some suggestions or solutions how can I correct my code...
this is the snippet of the code which Im trying to plot on the graph
private void show()
{
for (int i=1; i<=size-1; i++)
{
VX[i] = VX[i - 1] + (XA[i] * RecordTimer.Interval * 10.0);
VY[i] = VY[i - 1] + (YA[i] * RecordTimer.Interval * 10.0);
VZ[i] = VZ[i - 1] + (ZA[i] * RecordTimer.Interval * 10.0);
}
for (int i=0; i< size-1; i++){
DX[i] = VX[i] * RecordTimer.Interval;
DY[i] = VY[i] * RecordTimer.Interval;
DZ[i] = VZ[i] * RecordTimer.Interval;
}
for (int i=1; i<=size-1; i++)
{
DisX.Text += string.Format("{0: 0.00000000}\n", Convert.ToInt32(DX[i]).ToString());
DisY.Text += string.Format("{0: 0.00000000}\n", Convert.ToInt32(DY[i]).ToString());
DisZ.Text += string.Format("{0: 0.00000000}\n", Convert.ToInt32(DZ[i]).ToString());
}
for (int i=1; i<=size-1; i++) {
double x = DX[i];
double y = DY[i];
double z = DZ[i];
CXZ.Series["XZ"].Points.AddXY(x, -z);
CXY.Series["XY"].Points.AddXY(x, -y);
CYZ.Series["YZ"].Points.AddXY(y,-z);
}
}
suggestions are anxiously required.....
modified on Saturday, April 24, 2010 9:42 AM
|
|
|
|
|
Hi,
if RecordTimer happens to be a System.Windows.Forms.Timer you are overly optimistic about its accuracy; I suggest you read Timer surprises, and how to avoid them[^] and switch to another timing mechanism (Multimedia timer, or Stopwatch).
PS: check the code snippet shown, it is unreadable, lacking formatting and the necessary HTML and smiley escaping.
|
|
|
|
|
sorry for the formatting of the query...
well im not concerned with the timer here.. but I want to plot my distance array values into the graph rather a spline graph that makes a rough shape of a NUMERIC digit (0-9)
P.s : I am using a WIIMOTE to get acceleration
modified on Saturday, April 24, 2010 9:52 AM
|
|
|
|
|
As your timing is wrong, so are all accelerations, velocities and distances.
Furthermore, you're doing some "forward integration", which is a rude approximation, and a worse one for larger time steps; which is what you are getting.
|
|
|
|
|
so tell me what should I be doing to calculate the time of acceleration values from the wiimote?
|
|
|
|
|
further more.. I had fixed my time for the acceleration that is 10ms each time ...
I dont kno if it is correct or not .. but for estimation..
|
|
|
|
|
1.
you would have to tell a lot more about the system. Are you getting the acceleration values in real-time? or just post-processing them? what is the interface? what is the fastest you could get them?
2.
you should use actual time, not estimated time; your code implies time moves linearly from one sample to the next; there will be deviations that may throw you off. So measure and store Windows time for each sample you get, and use the time deltas in your math.
3.
numeric integration is a research topic, far beyond the scope of a forum like this one. when you have a sufficient number of samples (i.e. when the first and second derivative of your inputs are small) then all is fine whatever you do; when values change rapidly, forward integration is the worst you can do. You might apply the average of current acceleration and previous acc as a first-order improvement.
|
|
|
|
|
ok here is the full description for my project!
well Im getting real time values from the wiimote accelerometer in instance wiimote generate 100 (x,y and z) values per second.
now thats I store my values in a array , I calculate the velocity through the formula
Vi+1= Vi + ( Acceleration * time * gravity);
then from the velocity values I calculate the distance
DistanceX= Velocity * time
in the last Im tryin to plot the DistanceX and DistanceY on the spline graph but the shapes that include a little bit of circular motion doesnot plot on the graph but the line gets straight below the graph ...
for example if I try to make a gesture of a number "0" .. the graph shows an ARC shape on the graph.
all other gestures... (1,2,3,4,5,7) are plotted as it is... but (0,6,8,9) doesnt...
now what do u say for this...
waiting for your response...
modified on Saturday, April 24, 2010 10:35 AM
|
|
|
|
|
OK, some comments:
alibaba88s wrote: wiimote generate 100 (x,y and z) values per second.
so, you haven't convinced me yet you are getting the right values with the associated time value.
alibaba88s wrote: Vi+1= Vi + ( Acceleration * time * gravity);
1. gravity is not involved.
2. this is known as forward integration: you assume acceleration is constant from time point i to time point i+1 which it probably isn't
alibaba88s wrote: if I try to make a gesture of a number "0"
I don't know about MSChart; can it handle arbitrary shapes, or does it only work well for functions, i.e. where one position (x,y) only has one value (z)?
alibaba88s wrote: add me on the messenger
no thanks. I don't do chats and tweets.
I'm afraid you'll need to stretch a lot to get this working properly. Good luck.
|
|
|
|
|
Luc! thanx for your time! Im new to C# world ...
If U have heard about the Wiimote managed libraries (wiimotelib), according to brian peek, he says that the values are right.
Luc Pattyn wrote: 1. gravity is not involved.
luc! gravity is involved in it as when U hold the device in your hand.. the acceleration is affected by it.
what do U suggest how can I plot the shapes then?
MSChart does hold arbitrary values . for example! Im using
Mychart.series["xy"].addXY(x,y);
to plot the shapes in spline/scatter graph.
further more, as I already mentioned... others shapes do get plotted well on the scatter graph but the shapes involving circular motion doesnt...
|
|
|
|
|
gravity is needed for the Wiimote to work properly; it should not appear in the formula you gave, as acceleration, by definition, is the derivative of velocity over time.
alibaba88s wrote: others shapes do get plotted well
yes, all the ones without loops work fine; that is what triggered my remark. I suggest you test your way of plotting things by feeding it a series of synthetic points on a closed circle.
|
|
|
|
|
Luc Pattyn wrote: yes, all the ones without loops work fine; that is what triggered my remark. I suggest you test your way of plotting things by feeding it a series of synthetic points on a closed circle.
I ddnt get you!
well any other possible solution to get the shape tobe drawn properly..???
|
|
|
|
|
When I run the below code:
static void Main(string[] args)
{
//Variable to collect user input...
string userInput = " ";
// Output text to the screen.
Console.WriteLine("Enter your name:");
//Wait for user to make a key stroke.
Console.ReadKey();
//Read in what the user is entering and store it in the variable.
userInput = Console.ReadLine();
//Wait for user to make a key entry.
Console.ReadKey();
// Output text to the screen.
Console.WriteLine("Enter your name:");
//Read in what the user is entering and store it in the variable.
string userNext = Console.ReadLine();
//Output what the user has enter along with hello.
Console.WriteLine("hello,{0}, {1}", userInput, userNext);
//Wait for user to make a key entry.
Console.ReadKey();
}
The output of the second string is always missing the first letter, I can't figure out why. Here is the out up:
Enter your name:
John
Enter your name:
Sam
hello,ohn,Sam
|
|
|
|
|
what do you think Console.ReadKey(); does?
|
|
|
|
|
I can reproduce your result :
You don't hit Enter before typing "John".
Remove the lines
Console.ReadKey();
|
|
|
|
|
try this:
string userInput = " ";
Console.WriteLine("Enter your name:");
userInput = Console.ReadLine();
Console.WriteLine("Enter your name:");
string userNext = Console.ReadLine();
Console.WriteLine("hello,{0}, {1}", userInput, userNext);
Console.ReadKey();
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Many thanks guys this solved my problem.
|
|
|
|
|
Console.ReadKey is taking away the first Character of John. The second key might not be the problem because the Enter is still in the data stream and the second ReadKey() will take that enter, and so, Sam is not having its first character missing..
I hope you got me!!
- jaypatel512
|
|
|
|
|
i was using this code to filter a crystal report
crystalReportViewer1.SelectionFormula = "{DateOfOperation} = '" + datetime1+ "' ";
but now i don't use crystal report , iam using now clasic report so how to filter data in this case
Allah bless the prophet Mohammed
|
|
|
|
|
Hi
Try this link.[^]
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
I have a numerical modeling code that runs into a stack overflow problem when the data set gets large. The overflow happens as I step into a Fortran DLL. Just before the DLL I create several large double arrays to hold the results coming back from the DLL. I suspect these large arrays are part of the problem.
Is it possible to get these arrays allocated on the heap? Would I have to wrap them in a class to achieve this?
|
|
|
|
|
An array *is* a class. Anything allocated with new is put on the heap.
Is the Fortran DLL an unmanaged DLL? If it is, are you sure your prototypes for the methods in the DLL are correct? How big are your arrays?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|