|
Should also note that the solution will likely vary by country.
I suspect also that the usable definition of "bank" might vary as well.
|
|
|
|
|
Storing the data should not be too difficult.
Have two tables, one with the bank name joined to another that is contains country data.
The likely problem here is collating this data from a reliable source.
|
|
|
|
|
Hey guys, I have pretty much figured out my regression line doing some calculations, but drawing it is where I am stuck. The line comes from the y axis and goes through the middle of the chart roughly, once I get these two points I draw the line, but I do not know how to draw a line THROUGH the middle point to the end of the chart, can anyone please help me out?
Here is my chart code:
chart1.Series["Regression Line"].Points.AddXY(0, b0);
chart1.Series["Regression Line"].Points.AddXY(xAverage, yAverage);
chart1.Series["Regression Line"].ChartType = SeriesChartType.Line;
chart1.Series["Regression Line"].Color = Color.Red;
You can see the line goes from one point to another, but its only half the line, any assistance would be greatly appreciated I am completely stumped!
Many thanks!!!
|
|
|
|
|
The maths is pretty simple. If you have a line from (x0, y0) to (x1, y1) and want to extend it as far again to (x2, y2), then (x1, y1) is the midpoint of the line. x1 = (x0 + x2) / 2, etc.
Massage it a bit and you get
x2 = 2 * x1 - x0, y2 = 2 * y1 - y0.
Refactor to your variable names and that's it
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Thanks very much Peter I shall try and figure this out right now! Appreciated!
|
|
|
|
|
Peter after some experimenting, I got there, thanks to you, your equation made sense and it worked! Much appreciated!
Thank you!!
|
|
|
|
|
You're welcome.
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Hello. I have downloaded and used a code project sample to merge .pdf files and it's fantastic; probably saved me lots of hours of searching, testing, debugging, etc. However, I'd like to be able to put the page numbers on the bottom of a page that has landscape orientation; not portait, which is how the example is set up. Could anybody tell me how to do this? iTextSharp documentation is scant, to say the least. That's the downside of open source. Thank you.
Tom Paronis
|
|
|
|
|
|
Thank you. My VB skills have totally atrophied but I should still be able to translate this.
|
|
|
|
|
I am getting ExecutionEngineException during execution of application. This sometimes happens while closing the application. Tried with windbg tool but did not find anything useful. Application uses both managed and unmanaged code. Tried googling but i couldnt get breakthrough.
It would be greatly helpful if someone give expert idea on this investigation.
|
|
|
|
|
Look at the documentation[^] to see what extra information you can capture at the point of error. You should collect as much information as possible about what is going on and possibly send it to Microsoft for analysis.
|
|
|
|
|
How does one enumerate the z-order of mdi child windows?
If that's too much to ask, then how can I at least find out which window is currently on top?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Have you checked the 'ActiveMdiChild' property of the MDI Parent Form?
MSDN:Activemdichild[^]
Jibesh V P
|
|
|
|
|
Thanks!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
never mind. it happens to every one..
may be coz its friday eve
Jibesh V P
|
|
|
|
|
Although you've managed to get the top window, I thought this was an interesting one so I've had a play around.
Windows has a function EnumChildWindows[^] which gets the windows in Z order.
Something like this in the parent will get you an IEnumerable<Form> of the children in z order.
private delegate bool EnumChildProc(IntPtr hwnd, IntPtr lParam);
[DllImport("User32.dll")]
private static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
private IEnumerable<Form> GetChildrenSortedByZOrder()
{
List<IntPtr> handles = new List<IntPtr>();
if (IsHandleCreated)
{
EnumChildWindows(Handle,
(hWnd, lparam) =>
{
handles.Add(hWnd);
return true;
}, IntPtr.Zero);
}
List<Form> children = new List<Form>(handles.Count);
foreach (IntPtr handle in handles)
{
Form form = FromHandle(handle) as Form;
if (form != null)
children.Add(form);
}
return children;
}
|
|
|
|
|
After a bit of rooting around in the undergrowth of the outer form, I've found the ordered list of MDI windows.
The Form.MdiChildren property is a list of MDI children but the order is fixed in order in which the forms were created.
Enumeration of the Form.Controls collection will reveal an unnamed Control of type System.Windows.Forms.MdiClient whose Controls collection is the dynamically ordered list of MDI child forms. The first item is the form at the top of the Z-order.
private void ShowMdiChildren() {
log.WriteLine("MdiClient control collection");
log.WriteLine("============================");
foreach (Control c in this.Controls) {
if (c is System.Windows.Forms.MdiClient) {
System.Windows.Forms.Control.ControlCollection mdiColl = c.Controls;
foreach (Control mdiChild in mdiColl) {
log.WriteLine("{0,-2} {1, -20} {2, -16} {3}", mdiColl.GetChildIndex(mdiChild), mdiChild.Text, mdiChild.Name, mdiChild.GetType());
}
}
}
log.WriteLine();
}
By manipulation of the collection you can do fun things like reorder the child forms
private void RotateZOrder() {
foreach (Control c in this.Controls) {
if (c is MdiClient) {
Control.ControlCollection mdiColl = c.Controls;
if (mdiColl.Count >= 2) {
mdiColl.SetChildIndex(mdiColl[0], mdiColl.Count - 1);
}
}
}
}
Alan.
|
|
|
|
|
Hi,
I am creating a comma separated file with data from database.
The data is pretty much customer information.
Is there a way to code for special characters, like commas with the customer data?
Thanks!
|
|
|
|
|
I'd recommend to encode it in Base64. That way you can even throw (binary) pictures in there.
|
|
|
|
|
Surprisingly there is a standard for CSV.
Text Fields are surrounding by "". " escapes ", pretty simple.
|
|
|
|
|
How to optimise code every time needs to bind the grid
|
|
|
|
|
Your best of showing what code you think need optimization and others will let you know of potential improvements.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
sujeet321 wrote: How to optimise code
You do this by appying your VAST knowledge and experience in programming.
|
|
|
|
|
Look at the query first. Make sure you only pick up what you need to display.
Your gridview will be faster automatically.
|
|
|
|