|
If (null == something) and if (something == null) are nothing but the same.
But I/many people always prefer - If (null == something),
because if we use - if(something == null), sometimes it may happens that instead of == we use = and that change the value of 'something'. And if 'something' is used throuout the programe, you can imagine how wrong result it will create.
So using If (null == something) is always be safe.
Hope this will be helpful to you.
Thanks,
-Yogesh Patil.
|
|
|
|
|
Hi Ive been messing around with GDI+ and Ive managed to make a simple line graph by plotting the graph points and drawing a line between them .
However the result is rather ugly , Im trying to make a graph without points using a curved line but im not sure where to start .
Can anyone point me to an example or suggest a way to draw this type of graph/line ?
|
|
|
|
|
Hi,
look for Bezier curves or spline functions. They are everywhere on the internet, as well as in CP articles.
BTW: such curves will connect only a few points; for larger graphs, you need more curves, not polynomials of a higher order (they tend to oscillate too much).
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Yeah the only examples i can find are based on 3-4 points i need an example that can handle 50 points .
Basically i have a bunch of values and im incrementing the x values x 10 each time and i need a function that can take plot all this in one go using loops not manuly inouted information
|
|
|
|
|
The trick when more than 3 or 4 points need a smooth curve, is to apply a bezier or spline on a subset of those points, then move on and make sure there is continuity (same tangent).
Sorry I don't keep a reference around.
[ADDED] Googled for "continuous cubic splines" and found lots of things including this[^].
[/ADDED]
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
modified on Thursday, July 2, 2009 8:21 PM
|
|
|
|
|
Isnt that what the robot voice says at the start of sim city 2000
Perfect thanks
|
|
|
|
|
Hello all,
I'm looking for a faster way to get a string representation of a bitmap image without looping through the coordinates in the getpixel(x,y) method. Can it be done more efficiently?
Thanks.
|
|
|
|
|
Yes, use LockBits [^] and unsafe code. (getpixel also does something like that internally, it calls a native method that performs some magic and probably locks the bitmap as well)
|
|
|
|
|
Perhaps this is what you're looking for:
MSDN[^]
|
|
|
|
|
Thanks to both of you for the quick replies, and right on the money with them too.
|
|
|
|
|
Hi everyone,
My datagrid is populating all data. Now i want to add tabs to my WINFORM so that the data can be grouped according to the status_type. Can you let me know how this can be done. I am using Linq to query the database.
Thanks,
|
|
|
|
|
What is status_type? What does Linq have to do with tabs? What will be the purpose of the tabs?
|
|
|
|
|
Status_type relates to my AD Hoc query. It has a list of employees with their current status as "Active" , "In-Active" , "Overseas".....etc. I want to define tabs so that a tab named ACTIVE can list all the employees with the status "Active" and similarly the rest.
Cheers!
|
|
|
|
|
And I suppose you don't want multiple datagrids? Otherwise there wouldn't be any problem at all..
|
|
|
|
|
Hi,
what you could do is this:
- add a TabControl to your Form
- give it any number of TabPages you want
- put one DataGrid(View) on each TabPage
- create a different query for each TabPage
- make sure the queries don't get all launched at once, maybe just get one of them launched by the TabIndexChanged event (plus the initially visible one right away if necessary).
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
hi thanks, can u show me an example for writing queries into tabcontrols
|
|
|
|
|
Huh? A query (SQL, LINQ, whatever) does not care where it is located, it does not look different for a TabControl or TabPage.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hi,
im binding my datagridview to a datasource (List)
im then hiding a column, but I need to check that the datasource has bound, how do I do this?
thanks
|
|
|
|
|
Debugging? I don't know what exactly you need. Check if the datasource for the gridview is not null.
|
|
|
|
|
ziwez0 wrote: I need to check that the datasource has bound, how do I do this?
Why not checking the DataSource member ..? If it's not null then it's bound to a data source.
Moim Hossain
R&D Project Manager
BlueCielo ECM Solutions BV
|
|
|
|
|
Is the column you are hiding the only column in the DataGridView?
If it is then, I for one, do not understand what it is that you are trying to do!
If it is not, then just run the app. If there's data there the binding worked, if not it might not have.
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.”
|
|
|
|
|
Ah right, I cant hide the column until the databound is complete, (otherwise it throws up wried results)
|
|
|
|
|
Hi,
I am new to c# and getting this:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
...........................
.........................
any thoughts?
and also what about this?:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.String.ConcatArray(String[] values, Int32 totalLength)
at System.String.Concat(String[] values)
...........
............
thanks.
|
|
|
|
|
you're out of memory. Do you use image files or videos, or other unmanaged resources ? you need to call Dispose to clean them up, or this will happen. The Garbage collection is actually useless.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|