Zedgraph a simple example, code
VB.net code
===========CODE==============
Dim myPane As GraphPane
myPane = ZedGraphControlA.GraphPane
'title
myPane.Title="GRAPH"
myPane.YAxis.Title.Text = "Y"
myPane.XAxis.Title.Text = "X"
'set scale
myPane.XAxis.Scale.Max = 10
myPane.XAxis.Scale.Min = -10
myPane.YAxis.Scale.Max = 10
myPane.YAxis.Scale.Min = -10
'create a list
Dim list1 As New PointPairList
Dim i as integer
For i = 0 To 1
x = 0
y1 = 0
list1.Add(x, y1)
next i
'add a curve
myCurveA = myPane.AddCurve("", list1,color.blue, SymbolType.None)
'points to add
pts= myCurveA.Points
pts.Clear()
'add points
pts.Add(3,3)
pts.Add(4,4)
pts.Add(5,5)
pts.Add(6,6)
myPane.AxisChange()
' Make sure the Graph gets redrawn
ZedGraphControl1.Invalidate()
Search This Blog
Monday, June 29, 2009
Saturday, June 27, 2009
Friday, June 26, 2009
Friday, June 19, 2009
Some Optical Illusions....
Illusion 1.
To find what is hidden, attentively fix the 4 black spots of the center during 30 seconds, Then look at a blank white wall, or a piece of paper, or on the white space near image. What do you see?
On the white zone which appears, you should see a famous character of the History (to accentuate the effect you can close or blink eyes)

==========================================================
Illusion 2.
To find what is hidden, attentively fix the 4 black spots of the center during 30 seconds, Then look at a blank white wall, or a piece of paper, or on the white space near image. What do you see?
On the white zone which appears, you should see a famous character of the History (to accentuate the effect you can close or blink eyes)

==========================================================
Illusion 2.
If you continue to focus on the cross in the center of the image you will notice that ..
the violet circles will soon DISAPPEAR completely..
Thursday, June 18, 2009
Commands giving user information
* w --- tells you who's logged in, and what they're doing. Especially useful: the 'idle' part. This allows you to see whether they're actually sitting there typing away at their keyboards right at the moment.
* who --- tells you who's logged on, and where they're coming from. Useful if you're looking for someone who's actually physically in the same building as you, or in some other particular location.
* finger username --- gives you lots of information about that user, e.g. when they last read their mail and whether they're logged in. Often people put other practical information, such as phone numbers and addresses, in a file called .plan. This information is also displayed by 'finger'.
* last -1 username --- tells you when the user last logged on and off and from where. Without any options, last will give you a list of everyone's logins.
* talk username --- lets you have a (typed) conversation with another user
* write username --- lets you exchange one-line messages with another user
* elm --- lets you send e-mail messages to people around the world (and, of course, read them). It's not the only mailer you can use, but the one we recommend. See the elm page, and find out about the departmental mailing lists (which you can also find in /user/linguistics/helpfile).
* who --- tells you who's logged on, and where they're coming from. Useful if you're looking for someone who's actually physically in the same building as you, or in some other particular location.
* finger username --- gives you lots of information about that user, e.g. when they last read their mail and whether they're logged in. Often people put other practical information, such as phone numbers and addresses, in a file called .plan. This information is also displayed by 'finger'.
* last -1 username --- tells you when the user last logged on and off and from where. Without any options, last will give you a list of everyone's logins.
* talk username --- lets you have a (typed) conversation with another user
* write username --- lets you exchange one-line messages with another user
* elm --- lets you send e-mail messages to people around the world (and, of course, read them). It's not the only mailer you can use, but the one we recommend. See the elm page, and find out about the departmental mailing lists (which you can also find in /user/linguistics/helpfile).
Commands giving user information
* w --- tells you who's logged in, and what they're doing. Especially useful: the 'idle' part. This allows you to see whether they're actually sitting there typing away at their keyboards right at the moment.
* who --- tells you who's logged on, and where they're coming from. Useful if you're looking for someone who's actually physically in the same building as you, or in some other particular location.
* finger username --- gives you lots of information about that user, e.g. when they last read their mail and whether they're logged in. Often people put other practical information, such as phone numbers and addresses, in a file called .plan. This information is also displayed by 'finger'.
* last -1 username --- tells you when the user last logged on and off and from where. Without any options, last will give you a list of everyone's logins.
* talk username --- lets you have a (typed) conversation with another user
* write username --- lets you exchange one-line messages with another user
* elm --- lets you send e-mail messages to people around the world (and, of course, read them). It's not the only mailer you can use, but the one we recommend. See the elm page, and find out about the departmental mailing lists (which you can also find in /user/linguistics/helpfile).
* who --- tells you who's logged on, and where they're coming from. Useful if you're looking for someone who's actually physically in the same building as you, or in some other particular location.
* finger username --- gives you lots of information about that user, e.g. when they last read their mail and whether they're logged in. Often people put other practical information, such as phone numbers and addresses, in a file called .plan. This information is also displayed by 'finger'.
* last -1 username --- tells you when the user last logged on and off and from where. Without any options, last will give you a list of everyone's logins.
* talk username --- lets you have a (typed) conversation with another user
* write username --- lets you exchange one-line messages with another user
* elm --- lets you send e-mail messages to people around the world (and, of course, read them). It's not the only mailer you can use, but the one we recommend. See the elm page, and find out about the departmental mailing lists (which you can also find in /user/linguistics/helpfile).
Thursday, June 11, 2009
Message on the terminal.
Mesg X blinking on all your consoles.
Add these in ~/.profile
mesg X
[ `who -T |grep "$LOGNAME\ *+" |wc -l` -ge 1 ] && mesg X
Add these in ~/.profile
mesg X
[ `who -T |grep "$LOGNAME\ *+" |wc -l` -ge 1 ] && mesg X
Message on the terminal.
Mesg X blinking on all your consoles.
Add these in ~/.profile
mesg X
[ `who -T |grep "$LOGNAME\ *+" |wc -l` -ge 1 ] && mesg X
Add these in ~/.profile
mesg X
[ `who -T |grep "$LOGNAME\ *+" |wc -l` -ge 1 ] && mesg X
Saturday, June 6, 2009
Creating a DLL in VC++, and using it in VB.net, C#.net
STEP 1. Start a new project in VC++ as "win32 DLL"
STEP 2. Declare function in header file i.e class1.h as
extern "C" __declspec(dllexport) int add_2_nos(int a, int b);
extern "C" __declspec(dllexport) int mul_2_nos(int a, int b);
Let rest things as it is.
STEP 3. Define functions in cpp file i.e in class1.cpp as
#include "class1.h"
extern "C" __declspec(dllexport) int add_2_nos(int a, int b)
{ int c;
c=a+b;
return c;
}
extern "C" __declspec(dllexport) int mul_2_nos(int a, int b)
{ int c;
c=a*b;
return c;
}
STEP 4. Save file & Build & Build DLL
This will create a DLL in the release folder.
-----------------------------------------------------------
DLL in vb.net
STEP 1. Create a new project as "windows application" and code as
Imports System
Imports System.Runtime.InteropServices
Public Class a
DllImport("c:\MyDLL\vc_dll.dll", CharSet:=CharSet.Auto) _ 'in angular brackets
Public Shared Function add_2_nos(ByVal a As Integer, ByVal b As Integer) As Integer
End Function
End Class
Public Class Form1
'on button click
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim b As Integer
b = a.add_2_nos(2, 3)
MessageBox.Show(b.ToString)
End Sub
End Class
STEP 2. Save it run it , click on button
-----------------------------------------------------------
DLL in C#
STEP 1. Create a new project as "windows application" and code as
using System;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
[DllImport("C://MyDLL/vc_dll.dll")]
public static extern int add_2_nos(int a, int b);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int a;
a= add_2_nos(3,40);
MessageBox.Show(a.ToString());
}
}
}
STEP 2. Save it run it click on button.........
-------------------------------------------------------------------
Dll in copied in MyDLL folder in c: drive.
This dll can also be used in LabView
STEP 2. Declare function in header file i.e class1.h as
extern "C" __declspec(dllexport) int add_2_nos(int a, int b);
extern "C" __declspec(dllexport) int mul_2_nos(int a, int b);
Let rest things as it is.
STEP 3. Define functions in cpp file i.e in class1.cpp as
#include "class1.h"
extern "C" __declspec(dllexport) int add_2_nos(int a, int b)
{ int c;
c=a+b;
return c;
}
extern "C" __declspec(dllexport) int mul_2_nos(int a, int b)
{ int c;
c=a*b;
return c;
}
STEP 4. Save file & Build & Build DLL
This will create a DLL in the release folder.
-----------------------------------------------------------
DLL in vb.net
STEP 1. Create a new project as "windows application" and code as
Imports System
Imports System.Runtime.InteropServices
Public Class a
DllImport("c:\MyDLL\vc_dll.dll", CharSet:=CharSet.Auto) _ 'in angular brackets
Public Shared Function add_2_nos(ByVal a As Integer, ByVal b As Integer) As Integer
End Function
End Class
Public Class Form1
'on button click
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim b As Integer
b = a.add_2_nos(2, 3)
MessageBox.Show(b.ToString)
End Sub
End Class
STEP 2. Save it run it , click on button
-----------------------------------------------------------
DLL in C#
STEP 1. Create a new project as "windows application" and code as
using System;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
[DllImport("C://MyDLL/vc_dll.dll")]
public static extern int add_2_nos(int a, int b);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int a;
a= add_2_nos(3,40);
MessageBox.Show(a.ToString());
}
}
}
STEP 2. Save it run it click on button.........
-------------------------------------------------------------------
Dll in copied in MyDLL folder in c: drive.
This dll can also be used in LabView
Wednesday, June 3, 2009
Creating & Using DLL in VB.NET
How to create and use DLL in VB.NET?
STEP 1. Create a VB.NET project as "Class Library".
Write this code as example (change accordingly). You will get Class1 there just need add a fuction here vikas_add (adding 2 numbers & returning result). DLL will have same name as your project name.
-----------------------------------
Public Class Class1
Public Function vikas_add(ByVal a As Integer, ByVal b As Integer) As Integer
Return a + b
End Function
End Class
-------------------------------------
STEP 2. Save and Build the project. This will create DLL. (prob. in Release folder).
STEP 3. Register your DLL.
For this i follow these steps--
1) Start -> Run -> Regedit --- This will open Registry Editor
2) Locate HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders
3) Right click AssemblyFolders and select New -> Key
4) Give any name. (i gave MyDLLs)
5) Select MyDLLs, double click on default in right pane, give path like (c:\MyDLL) which i have given.
6) Close Registry editor
7) Create a folder c:\MyDLL and copy you dll created above in this folder.
STEP 3. Create a new project as "Windows Application".
Add Reference as--> Project --> Add reference.
In .NET Tab you will get Component name as ClassLibrary1 and Path as your folder and DLL. Select that and click on OK. You can check in All Files in Project Explorer, in references.
CODE eg
---------------------------------------------------
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As New ClassLibrary1.Class1 'Here classLibrary1.class1 is your DLL class which have vikas_add function
Dim txt1, txt2, res As Integer
txt1 = TextBox1.Text
txt2 = TextBox2.Text
'MessageBox.Show(obj.vikas_add(txt1, txt2))
res = obj.vikas_add(txt1, txt2)
Label2.Text = "Result of Numbers=" & res.ToString
End Sub
End Class
---------------------------------------------------
STEP 4. Save and Run........
----------------------------------------------------------------------------
There is also a way in VB.NET to use DLL, by add these 2 statemets, but dint work for me, every time i m getting entry point error. But with above i able to use DLL's function.
Whts tht?
can anybody comments?
Imports System.Runtime.InteropServices
_
Public Shared Function vikas_add(ByVal aa As Integer, ByVal bb As Integer) As Integer
End Function
STEP 1. Create a VB.NET project as "Class Library".
Write this code as example (change accordingly). You will get Class1 there just need add a fuction here vikas_add (adding 2 numbers & returning result). DLL will have same name as your project name.
-----------------------------------
Public Class Class1
Public Function vikas_add(ByVal a As Integer, ByVal b As Integer) As Integer
Return a + b
End Function
End Class
-------------------------------------
STEP 2. Save and Build the project. This will create DLL. (prob. in Release folder).
STEP 3. Register your DLL.
For this i follow these steps--
1) Start -> Run -> Regedit --- This will open Registry Editor
2) Locate HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders
3) Right click AssemblyFolders and select New -> Key
4) Give any name. (i gave MyDLLs)
5) Select MyDLLs, double click on default in right pane, give path like (c:\MyDLL) which i have given.
6) Close Registry editor
7) Create a folder c:\MyDLL and copy you dll created above in this folder.
STEP 3. Create a new project as "Windows Application".
Add Reference as--> Project --> Add reference.
In .NET Tab you will get Component name as ClassLibrary1 and Path as your folder and DLL. Select that and click on OK. You can check in All Files in Project Explorer, in references.
CODE eg
---------------------------------------------------
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As New ClassLibrary1.Class1 'Here classLibrary1.class1 is your DLL class which have vikas_add function
Dim txt1, txt2, res As Integer
txt1 = TextBox1.Text
txt2 = TextBox2.Text
'MessageBox.Show(obj.vikas_add(txt1, txt2))
res = obj.vikas_add(txt1, txt2)
Label2.Text = "Result of Numbers=" & res.ToString
End Sub
End Class
---------------------------------------------------
STEP 4. Save and Run........
----------------------------------------------------------------------------
There is also a way in VB.NET to use DLL, by add these 2 statemets, but dint work for me, every time i m getting entry point error. But with above i able to use DLL's function.
Whts tht?
can anybody comments?
Imports System.Runtime.InteropServices
Public Shared Function vikas_add(ByVal aa As Integer, ByVal bb As Integer) As Integer
End Function
Subscribe to:
Comments (Atom)




