+ Rename your zip file from "file.zip" to something else like "file.zip_renameThisFile1".
+ Hit "Compose mail" button on the left panel.
+ Fill out the email address to send "To:".
+ Attached the renamed zip file.
+ Hit Send.
Reading. Practice. Writing.
Please feel free to comment. Suggestions are also welcomed here. Write something "wholesome serving purpose" here.
Sunday
Wednesday
How to install, run, and test VPython, the 3D graphics module for Python programming language?
Download and install Python-2.7.2 from http://www.python.org/download/. Important: Install it in C:\Python27.
Download and install VPython-Win-Py2.7-5.72 from http://vpython.org/contents/download_windows.html.
Start the VPython program with "Python 2.7 IDLE (Python GUI)" shortcut on the Start menu.
In the Python 2.7.2 shell, type the following:
>>> from visual import *
>>> sphere ()
<vis.primitives.sphere object at 0x0275EE10>
>>>
A 3D object window will pop up.
Right button drag on a mouse to rotate camera to view scene.
Left and right buttons drag up or down to zoom in or out.
Download and install VPython-Win-Py2.7-5.72 from http://vpython.org/contents/download_windows.html.
Start the VPython program with "Python 2.7 IDLE (Python GUI)" shortcut on the Start menu.
In the Python 2.7.2 shell, type the following:
>>> from visual import *
>>> sphere ()
<vis.primitives.sphere object at 0x0275EE10>
>>>
A 3D object window will pop up.
Right button drag on a mouse to rotate camera to view scene.
Left and right buttons drag up or down to zoom in or out.
Qt Yin Yang Symbol
Source code: #include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsEllipseItem>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QGraphicsScene scene;
scene.setSceneRect( 0.0, 0.0, 200.0, 200.0 );
QBrush whiteBrush(Qt::white);
QBrush blackBrush(Qt::black);
QPen blackPen(Qt::black);
blackPen.setWidth(3);
QPen whitePen(Qt::white);
whitePen.setWidth(3);
scene.addEllipse(0,0,200,200,blackPen,blackBrush); //big circle
QPainterPath rightWhiteSemicirclePath;
rightWhiteSemicirclePath.arcMoveTo(0+3, 0+3, 200-2*3, 200-2*3, 90);
rightWhiteSemicirclePath.arcTo(0+3, 0+3, 200-2*3, 200-2*3, 90, -180);
scene.addPath(rightWhiteSemicirclePath,whitePen,whiteBrush);
QPainterPath leftUpperSmallWhiteSemicirclePath;
//circle contains in the square shape
//square length is 100-3=97
//move the small square x position left (1/4*200)+3=53 pixels
leftUpperSmallWhiteSemicirclePath.arcMoveTo(50+3, 0+3, 100-3, 100-3, -90);
leftUpperSmallWhiteSemicirclePath.arcTo(50+3, 0+3, 100-3, 100-3, -90, -180);
scene.addPath(leftUpperSmallWhiteSemicirclePath,whitePen,whiteBrush);
QPainterPath rightLowerSmallBlackSemicirclePath;
rightLowerSmallBlackSemicirclePath.arcMoveTo(53-3, 100+3, 100-3, 100-3, 90);
rightLowerSmallBlackSemicirclePath.arcTo(53-3, 100+3, 100-3, 100-3, 90, -180);
scene.addPath(rightLowerSmallBlackSemicirclePath,blackPen,blackBrush);
scene.addEllipse(100-12.5, 50-12.5, 25, 25, blackPen, blackBrush); //small black upper circle
scene.addEllipse(100-12.5, 150-12.5, 25, 25, whitePen, whiteBrush); //small white lower circle
QGraphicsView view( &scene );
view.setFixedSize(300,300);
view.setWindowTitle("My Yin Yang Symbol");
view.show();
return app.exec();
}
Result:
☯
Tuesday
ClipsTab (ClipsTab = Clips + Protege) Installation Steps
Step: Download and install Protege v3.4.7 from
http://protege.stanford.edu/download/protege/3.4/installanywhere/Web_Installers/.
Choose without Java VM if you have installed Java Virtual Machine already.
Step: Download and extract ClipsTab zip file from
http://protege.stanford.edu/plugins/CLIPSTabPages/clipstab.zip.
ClipsTab zip file contains two files. The files are clipstab.jar and ProtegeCLIPSInterface.dll.
Create a folder in the "C:\Program Files\Protege_3.4.7\plugins" and name the folder as "ClipsTab".
Copy clipstab.jar to the "C:\Program Files\Protege_3.4.7\plugins\ClipsTab" folder.
Copy ProtegeCLIPSInterface.dll to the "C:\Program Files\Protege_3.4.7" folder.
Step: In the "C:\Program Files\Protege_3.4.7\plugins\ClipsTab" folder, create a text file
and name the file as "plugin.properties".
Type the following text into the "plugin.properties" file:
--
plugin.component.count=1
plugin.component.name.0=ClipsTab Plugin
plugin.component.about.0=http://protege.stanford.edu/plugins/CLIPSTabPages/CLIPS_tab.html
plugin.component.doc.0=http://protege.stanford.edu/plugins/CLIPSTabPages/docs/index.html
plugin.dependency.count=2
plugin.dependency.0=edu.stanford.smi.protegex.owl
plugin.dependency.1=edu.stanford.smi.protegex.pal_tabs
--
Step: Download and extract Clips v6.24 zip file (windows_executables_624.zip) from
http://sourceforge.net/projects/clipsrules/files/CLIPS/6.24/.
Copy the followingfour files one file "clips.hlp, CLIPS6.HLP, clipsdos.exe, and CLIPSWin.exe" from the extracted Clips zip file to
the "C:\Program Files\Protege_3.4.7\plugins\ClipsTab" folder.
Step: Click [Start > All Programs > Protege_3.4.7 > Protege] to open Protege program.
On the Protege program, tick "CLIPSTab" and then click OK to enable the "CLIPS tab" under
[Menu > Project > Configure... > TabWidgets tab].
http://protege.stanford.edu/download/protege/3.4/installanywhere/Web_Installers/.
Choose without Java VM if you have installed Java Virtual Machine already.
Step: Download and extract ClipsTab zip file from
http://protege.stanford.edu/plugins/CLIPSTabPages/clipstab.zip.
ClipsTab zip file contains two files. The files are clipstab.jar and ProtegeCLIPSInterface.dll.
Create a folder in the "C:\Program Files\Protege_3.4.7\plugins" and name the folder as "ClipsTab".
Copy clipstab.jar to the "C:\Program Files\Protege_3.4.7\plugins\ClipsTab" folder.
Copy ProtegeCLIPSInterface.dll to the "C:\Program Files\Protege_3.4.7" folder.
Step: Download and extract Clips v6.24 zip file (windows_executables_624.zip) from
http://sourceforge.net/projects/clipsrules/files/CLIPS/6.24/.
Copy the following
the "C:\Program Files\Protege_3.4.7\plugins\ClipsTab" folder.
Step: Click [Start > All Programs > Protege_3.4.7 > Protege] to open Protege program.
On the Protege program, tick "CLIPSTab" and then click OK to enable the "CLIPS tab" under
[Menu > Project > Configure... > TabWidgets tab].
Wednesday
Simple Qt Console Application
- Click Start Menu > All Programs > Qt SDK > Qt Creator to open Qt 4 C++ Editor.
- On Qt Creator, click Menubar > File > New File or Project... Ctrl+N to create a new project.
- At LHS panel, Choose a template: Other Project. At RHS panel, click Qt Console Application. Click "Choose..." button to create a project containing a single main.cpp file with a stub implementation.
- Give the file a name as "cpp_simple_hello_world". Create in: D:\ws_qt. Click Next button to continue.
- Uncheck "Qt 4.7.3 for Desktop - MSVC2008 (Qt SDK) debug" and "Qt 4.7.3 for Desktop - MSVC2008 (Qt SDK) release" if there is any. Click Next button to continue.
- Click Finish.
- In the main.cpp file, enter the following source code for the file content.
#include <QtCore/QCoreApplication>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
cout << "Hello, World!" << endl;
return a.exec();
}
---------|---------|---------|---------|
- Ctrl+R to run the Qt (cute, cutie, Q.T. pronunciation) console application.
Friday
Where is the Firefox 6 status bar?
To enable Firefox 6 status bar,
click on Menu|View|Toolbars|Add-on Bar Ctrl+/.
click on Menu|View|Toolbars|Add-on Bar Ctrl+/.
Sunday
[Fahrenheit <=> Celsius] Temperature Converter Tutorial using Qt Designer, Qt Creator
Choose Qt Creator Menu | File |New File or Project… | Qt Widget Project | Qt Gui Application.
Widget
|
Property
|
Value
|
MainWindowTempConverter
|
windowTitle
|
[Fahrenheit <=> Celsius] Temperature Converter
|
lineEditFahrenheit
|
None
|
None
|
lineEditCelsius
|
None
|
None
|
labelFahrenheit
|
text
|
Fahrenheit value:
|
labelCelsius
|
text
|
Celsius value:
|
Right click widget | Go to slot… | “Go to slot” window pops up | Select signal: returnPressed()
Widget, Slot
|
Signal
|
Implementation
|
lineEditFahrenheit
|
returnPressed()
|
See code below
|
lineEditCelsius
|
returnPressed()
|
See code below
|
void MainWindow::on_lineEditFahrenheit_returnPressed()
{
QString strFahrenheit = ui->lineEditFahrenheit->text(); //try 212F = 100C
double fahrenheit = strFahrenheit.toDouble();
double celsius = (fahrenheit - 32)*5.0/9;
qDebug() << celsius << endl; //needs to "#include <QtDebug>"
QString strCelsius;
strCelsius.setNum(celsius, 'f', 0);
//f format is without E/10^.
//zero is the precision where zero number of digits after the decimal point.
// Other valid character formats are 'e', 'E', 'f', 'g' and 'G'.
// 'g' is after E and F, g uses either e or f format.
ui->lineEditCelsius->setText(strCelsius);
}
void MainWindow::on_lineEditCelsius_returnPressed()
{
QString strCelsius = ui->lineEditCelsius->text();
double celsius = strCelsius.toDouble();
double fahrenheit = 9/5.0*celsius + 32;
qDebug() << fahrenheit << endl;
QString strFahrenheit;
strFahrenheit.setNum(fahrenheit, 'f', 0);
ui->lineEditFahrenheit->setText(strFahrenheit);
}
Press “Ctrl+R” to compile and run Qt project.
Notes:
Press F1 for Context Help of Qt function names.
For a better Qt help, click Help Mode Selector at the LHS toolbar, then choose "Index" from drop down menu. Using this way, you can look for more information for any Qt function names.
Thursday
Friday
Flowchart Drawing and Programming using Raptor software
Raptor acronym stands for Rapid Algorithmic Prototyping Tool for Ordered Reasoning. This program is useful to draw flowcharts. Design computer program using flowchart without fixing to any specific programming language helps students to develop problem solving skills and improve algorithmic thinking.
Example of problem:
Draw a flowchart to accept a number and display all the numbers from 0 to the number entered.
One of the possible Flowchart Design Solutions:
Lectures or Labs Pedagogy:
+ Input symbol: Put double quote around the input prompt. For example, "Enter number: ".
+ Output symbol: No newline for the output message, uncheck the "End current line" checkbox. Use the plus symbol to append between variable and string.
+ Slide play speed slider to the maximum and click play button at the Raptor toolbar to get final program result without waiting for the animation to finish running. If you would like to have step by step animation, click on the "Step to Next Shape" toolbar button.
To generate C++ code:
+ Click on Menu | Generate | C++
+ The following code will be generated by Raptor:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
?? count;
?? n;
n =0;
raptor_prompt_variable_zzyz ="Enter number: ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> n;
count =0;
while (!(count>n))
{
cout << count+" "; count =count+1;
}
return 0;
}
+ Modify the above source code to following to make the flowchart executable as C++ program:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int count;
int n;
//add spaces as needed to improve code readability
n = 0;
raptor_prompt_variable_zzyz = "Enter number: ";
cout << raptor_prompt_variable_zzyz; //remove endl here
cin >> n;
count = 0;
while( !(count>n) )
{
cout << count << " ";
count = count + 1; //add newline for this statement
}
return 0;
}
Sample Run 1:
Enter number: 10
0 1 2 3 4 5 6 7 8 9 10
Hope with this tutorial, students will love to do programming even more.
Have Fun!
Example of problem:
Draw a flowchart to accept a number and display all the numbers from 0 to the number entered.
One of the possible Flowchart Design Solutions:
Lectures or Labs Pedagogy:
+ Input symbol: Put double quote around the input prompt. For example, "Enter number: ".
+ Output symbol: No newline for the output message, uncheck the "End current line" checkbox. Use the plus symbol to append between variable and string.
+ Slide play speed slider to the maximum and click play button at the Raptor toolbar to get final program result without waiting for the animation to finish running. If you would like to have step by step animation, click on the "Step to Next Shape" toolbar button.
To generate C++ code:
+ Click on Menu | Generate | C++
+ The following code will be generated by Raptor:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
?? count;
?? n;
n =0;
raptor_prompt_variable_zzyz ="Enter number: ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> n;
count =0;
while (!(count>n))
{
cout << count+" "; count =count+1;
}
return 0;
}
+ Modify the above source code to following to make the flowchart executable as C++ program:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int count;
int n;
//add spaces as needed to improve code readability
n = 0;
raptor_prompt_variable_zzyz = "Enter number: ";
cout << raptor_prompt_variable_zzyz; //remove endl here
cin >> n;
count = 0;
while( !(count>n) )
{
cout << count << " ";
count = count + 1; //add newline for this statement
}
return 0;
}
Sample Run 1:
Enter number: 10
0 1 2 3 4 5 6 7 8 9 10
Hope with this tutorial, students will love to do programming even more.
Have Fun!
How to Disable Real Player AutoUpdate?
Use this unobtrusive method, if you prefer manual update.
Click on Real Player Start Menu | Preferences...
Preference window will pop up
Click on LHS Panel | Automatic Services | AutoUpdate
Uncheck the Automatically download and install important updates checkbox
Click OK to close the window
Click on Real Player Start Menu | Preferences...
Preference window will pop up
Click on LHS Panel | Automatic Services | AutoUpdate
Uncheck the Automatically download and install important updates checkbox
Click OK to close the window
Tuesday
OMNeT++ tictoc10.ned, txc10.cc Solution
TicToc10 Exercise Question:
You'll notice that this simple "routing" is not very efficient: often the packet keeps bouncing between two nodes for a while before it is sent to a different direction. This can be improved somewhat if nodes don't send the packet back to the sender. Implement this.
Hints: cMessage::getArrivalGate(), cGate::getIndex().
Note that if the message didn't arrive via a gate but was a self-message, then getArrivalGate() returns NULL.
Source: http://www.omnetpp.org/doc/omnetpp/tictoc-tutorial/part3.html
TicToc10 Solution:
You'll notice that this simple "routing" is not very efficient: often the packet keeps bouncing between two nodes for a while before it is sent to a different direction. This can be improved somewhat if nodes don't send the packet back to the sender. Implement this.
Hints: cMessage::getArrivalGate(), cGate::getIndex().
Note that if the message didn't arrive via a gate but was a self-message, then getArrivalGate() returns NULL.
Source: http://www.omnetpp.org/doc/omnetpp/tictoc-tutorial/part3.html
TicToc10 Solution:
void Txc10::forwardMessage(cMessage *msg) { // In this example, we just pick a random gate (gate outs size) to send it on. // We draw a random number between 0 and the size of gate `out[]'. int n = gateSize("out"); int k = intuniform(0,n-1); cGate *arrivalGate = msg->getArrivalGate(); //int arrivalGateIndex = arrivalGate->getIndex(); // null pointer exception runtime error // because the first message sent by scheduleAt is a self-message if (arrivalGate == NULL) //self-message, do what? { // In this case, you may want to actually do something once the self // message "fires". Otherwise, as you've seen, the simulation ends there. // In short, you could just send the self message. EV << "Forwarding self message " << msg << " on port out[" << k << "]\n"; send(msg, "out", k); } else if (arrivalGate != NULL) // if it is not a self-message, get arrivalGateIndex { int arrivalGateIndex = arrivalGate->getIndex(); if (n >= 2) //if out gates are more than 1, easy //this line is needed to avoid infinite loop because you can send back to the sender //if there is only one output gate { while (arrivalGateIndex == k) { k = intuniform(0,n-1); } } EV << "Forwarding message " << msg << " on port out[" << k << "]\n"; send(msg, "out", k); } }
Wednesday
OMNeT++ and MANET Routing (aodv, dsr, etc) using INETMANET Framework
Download and install WinPcap v4.1.2 from
http://www.winpcap.org/install/default.htm.
Winpcap is used by INET to capture network packets from external interfaces.
This step will install Driver and DLL files like C:\Windows\System32\wpcap.dll.
Q: How can I see if WinPcap is currently running on my Win2K/XP/2k3/Win7 machine?
A: Click on the Start button and then on run. Type msinfo32. The System Information panel will show up. Choose Software Environment, then System Drivers. The entry NPF should appear there. If you launched a WinPcap application previously, the state should be running. Remember that WinPcap should have been run at least one time in order to appear in this list.
Name: npf
Description: NetGroup Packet Filter Driver
File: c:\windows\system32\drivers\npf.sys
Type: Kernel Driver
Started: Yes
Start Mode: Auto
State: Running
Download and extract WinPcap 4.1.2 Developer's Pack from
http://www.winpcap.org/devel.htm.
Copy all files from D:\WinpcapDeveloperPack_4_1_2\WpdPack\Include to
C:\omnetpp-4.1-rc2-src-windows\mingw\include and
C:\omnetpp-4.1-rc2-src-windows\mingw\lib\gcc\mingw32\4.5.0\include.
Copy all files from D:\WinpcapDeveloperPack_4_1_2\WpdPack\Lib to
C:\omnetpp-4.1-rc2-src-windows\mingw\lib and
C:\omnetpp-4.1-rc2-src-windows\mingw\lib\gcc\mingw32\4.5.0.
Make a copy of D:\WinpcapDeveloperPack_4_1_2\WpdPack\Lib\wpcap.lib.
Name the new copy as pcap.lib.
Copy to C:\omnetpp-4.1-rc2-src-windows\mingw\lib\pcap.lib.
Make a copy of D:\WinpcapDeveloperPack_4_1_2\WpdPack\Lib\libwpcap.a.
Name the new copy as libpcap.a.
Copy to C:\omnetpp-4.1-rc2-src-windows\mingw\lib\libpcap.lib.
Download inetmanet-20101013-src.tgz for OMNeT++ from
https://github.com/inetmanet/inetmanet.
If you intend to use inetmanet-2.0-integration.zip, download it from
https://github.com/aarizaq/inetmanet-2.0.
Extract inetmanet-20101013-src.tgz into OMNeT++ workspace directory
C:\omnetpp-4.1-rc2-src-windows\samples\inetmanet-20101013-src.
The extracted directory must be a subdirectory of the workspace directory.
Double-click to open OMNeT++ IDE.
Import the project using: File | Import... | General | Existing Projects into Workspace.
Select root directory: C:\omnetpp-4.1-rc2-src-windows\samples.
Make sure "inetmanet-20101013-src" project is checked.
Be sure NOT to check the "Copy projects into workspace" box.
Click Finish.
Open the "inetmanet-20101013-src" project if it is not open and wait until the indexer finishes.
Build the inetmanet project by pressing Ctrl+B (Project | Build all). Wait until it finish building.
If you get not enough memory error, restart your PC first.
To run an example from the OMNeT++ IDE open the example's directory in the Project Explorer view, find the corresponding omnetpp.ini file. Right click on it and select Run As / OMNeT++ Simulation. This should create a Launch Configuration with two Simulator windows (Network Animation and Timeline) for this example.
If the build was successful, you may try running the OMNeT++ Demo Simulations from the MSYS Bash Shell.
Welcome to OMNeT++ 4.1!
$ cd samples
$ pwd
/c/omnetpp-4.1-rc2-src-windows/samples
$ cd inetmanet-20101013-src
$ cd examples/
{username}@{computername} ~/samples/inetmanet-20101013-src/examples
$ ./rundemo
{username}@{computername} ~/samples/inetmanet-20101013-src/examples
$
Notes:
Recognized Environment Variables:
%WINDIR% = %SYSTEMROOT% = C:\Windows
%WINDIR%\system32 = C:\Windows\System32 //32-bit system
%WINDIR%\system = C:\Windows\system //16-bit system
%USERPROFILE% = C:\Users\{username}
%TEMP% = %TMP% = C:\Users\{username}\AppData\Local\Temp
C:\>echo %path%
D:\xerces-c-2.8.0-vc-8.0\bin;C:\Qt\2010.05\qt\bin;C:\Qt\2010.05\mingw\bin;
C:\Perl\bin;C:\Program Files\Java\jdk1.6.0_24\bin;
C:\Python26;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
C:\Program Files\Notepad++;
C:\>echo %comspec%
C:\Windows\system32\cmd.exe
C:\>echo %date%
Wed 11/05/2011
C:\>echo %cd%
C:\
C:\>echo %random% //returns a random number between 0 and 32767
27081
C:\>echo %time%
8:57:25.75
%AppData% = C:\Users\{username}\AppData\Roaming
%SystemDrive% = C:\
%ProgramFiles% = C:\Program Files
%CommonProgramFiles% = C:\Program Files\Common Files
http://www.winpcap.org/install/default.htm.
Winpcap is used by INET to capture network packets from external interfaces.
This step will install Driver and DLL files like C:\Windows\System32\wpcap.dll.
Q: How can I see if WinPcap is currently running on my Win2K/XP/2k3/Win7 machine?
A: Click on the Start button and then on run. Type msinfo32. The System Information panel will show up. Choose Software Environment, then System Drivers. The entry NPF should appear there. If you launched a WinPcap application previously, the state should be running. Remember that WinPcap should have been run at least one time in order to appear in this list.
Name: npf
Description: NetGroup Packet Filter Driver
File: c:\windows\system32\drivers\npf.sys
Type: Kernel Driver
Started: Yes
Start Mode: Auto
State: Running
Download and extract WinPcap 4.1.2 Developer's Pack from
http://www.winpcap.org/devel.htm.
Copy all files from D:\WinpcapDeveloperPack_4_1_2\WpdPack\Include to
C:\omnetpp-4.1-rc2-src-windows\mingw\include and
C:\omnetpp-4.1-rc2-src-windows\mingw\lib\gcc\mingw32\4.5.0\include.
Copy all files from D:\WinpcapDeveloperPack_4_1_2\WpdPack\Lib to
C:\omnetpp-4.1-rc2-src-windows\mingw\lib and
C:\omnetpp-4.1-rc2-src-windows\mingw\lib\gcc\mingw32\4.5.0.
Make a copy of D:\WinpcapDeveloperPack_4_1_2\WpdPack\Lib\wpcap.lib.
Name the new copy as pcap.lib.
Copy to C:\omnetpp-4.1-rc2-src-windows\mingw\lib\pcap.lib.
Make a copy of D:\WinpcapDeveloperPack_4_1_2\WpdPack\Lib\libwpcap.a.
Name the new copy as libpcap.a.
Copy to C:\omnetpp-4.1-rc2-src-windows\mingw\lib\libpcap.lib.
Download inetmanet-20101013-src.tgz for OMNeT++ from
https://github.com/inetmanet/inetmanet.
If you intend to use inetmanet-2.0-integration.zip, download it from
https://github.com/aarizaq/inetmanet-2.0.
Extract inetmanet-20101013-src.tgz into OMNeT++ workspace directory
C:\omnetpp-4.1-rc2-src-windows\samples\inetmanet-20101013-src.
The extracted directory must be a subdirectory of the workspace directory.
Double-click to open OMNeT++ IDE.
Import the project using: File | Import... | General | Existing Projects into Workspace.
Select root directory: C:\omnetpp-4.1-rc2-src-windows\samples.
Make sure "inetmanet-20101013-src" project is checked.
Be sure NOT to check the "Copy projects into workspace" box.
Click Finish.
Open the "inetmanet-20101013-src" project if it is not open and wait until the indexer finishes.
Build the inetmanet project by pressing Ctrl+B (Project | Build all). Wait until it finish building.
If you get not enough memory error, restart your PC first.
To run an example from the OMNeT++ IDE open the example's directory in the Project Explorer view, find the corresponding omnetpp.ini file. Right click on it and select Run As / OMNeT++ Simulation. This should create a Launch Configuration with two Simulator windows (Network Animation and Timeline) for this example.
If the build was successful, you may try running the OMNeT++ Demo Simulations from the MSYS Bash Shell.
Welcome to OMNeT++ 4.1!
$ cd samples
$ pwd
/c/omnetpp-4.1-rc2-src-windows/samples
$ cd inetmanet-20101013-src
$ cd examples/
{username}@{computername} ~/samples/inetmanet-20101013-src/examples
$ ./rundemo
{username}@{computername} ~/samples/inetmanet-20101013-src/examples
$
Notes:
Recognized Environment Variables:
%WINDIR% = %SYSTEMROOT% = C:\Windows
%WINDIR%\system32 = C:\Windows\System32 //32-bit system
%WINDIR%\system = C:\Windows\system //16-bit system
%USERPROFILE% = C:\Users\{username}
%TEMP% = %TMP% = C:\Users\{username}\AppData\Local\Temp
C:\>echo %path%
D:\xerces-c-2.8.0-vc-8.0\bin;C:\Qt\2010.05\qt\bin;C:\Qt\2010.05\mingw\bin;
C:\Perl\bin;C:\Program Files\Java\jdk1.6.0_24\bin;
C:\Python26;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
C:\Program Files\Notepad++;
C:\>echo %comspec%
C:\Windows\system32\cmd.exe
C:\>echo %date%
Wed 11/05/2011
C:\>echo %cd%
C:\
C:\>echo %random% //returns a random number between 0 and 32767
27081
C:\>echo %time%
8:57:25.75
%AppData% = C:\Users\{username}\AppData\Roaming
%SystemDrive% = C:\
%ProgramFiles% = C:\Program Files
%CommonProgramFiles% = C:\Program Files\Common Files
[solved] OMNeT++ and WinPcap c:/mingw32/bin/ld.exe: cannot find -lpcap, error: 'PCAP_SRC_IF_STRING' undeclared
Problem 1:
On the MSYS Bash Shell,
$ gcc -o testprog testprog.c -lpcap
c:/omnetpp-4.1-rc2-src-windows/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -lpcap
Solution. Change from -lpcap to -lwpcap:
$ gcc -o testprog testprog.c -lwpcap
This is because
C:\omnetpp-4.1-rc2-src-windows\mingw\lib\wpcap.lib and
C:\omnetpp-4.1-rc2-src-windows\mingw\lib\libwpcap.a.
Problem 2:
$ gcc -o testprog testprog.c -lwpcap
testprog.c: In function 'main':
testprog.c:12:29: error: 'PCAP_SRC_IF_STRING' undeclared (first use in this function)
Solution:
Change from
//if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL /* auth is not needed */, &alldevs, errbuf) == -1)
to
if (pcap_findalldevs_ex("127.0.0.1", NULL, &alldevs, errbuf) == -1)
{
...
}
The 127.0.0.1 is the localhost IP number.
Run it. On my Windows 7 workstation, the obtained result is:
$ testprog
1. rpcap://\Device\NPF_{88888888-4444-4444-4444-48D0E52A0B83} (Network adapter 'Atheros(NDIS6.20)' on local host)
2. rpcap://\Device\NPF_{88888888-4444-4444-4444-8B5EC6C7F430} (Network adapter 'Sun' on local host)
On the MSYS Bash Shell,
$ gcc -o testprog testprog.c -lpcap
c:/omnetpp-4.1-rc2-src-windows/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -lpcap
Solution. Change from -lpcap to -lwpcap:
$ gcc -o testprog testprog.c -lwpcap
This is because
C:\omnetpp-4.1-rc2-src-windows\mingw\lib\wpcap.lib and
C:\omnetpp-4.1-rc2-src-windows\mingw\lib\libwpcap.a.
Problem 2:
$ gcc -o testprog testprog.c -lwpcap
testprog.c: In function 'main':
testprog.c:12:29: error: 'PCAP_SRC_IF_STRING' undeclared (first use in this function)
Solution:
Change from
//if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL /* auth is not needed */, &alldevs, errbuf) == -1)
to
if (pcap_findalldevs_ex("127.0.0.1", NULL, &alldevs, errbuf) == -1)
{
...
}
The 127.0.0.1 is the localhost IP number.
Run it. On my Windows 7 workstation, the obtained result is:
$ testprog
1. rpcap://\Device\NPF_{88888888-4444-4444-4444-48D0E52A0B83} (Network adapter 'Atheros(NDIS6.20)' on local host)
2. rpcap://\Device\NPF_{88888888-4444-4444-4444-8B5EC6C7F430} (Network adapter 'Sun' on local host)
Tuesday
OMNeT++ v4.1, v4.1 rc2, v4.2.2, v4.3 or v4.3.1, how to install and run
Download and install Java from http://www.java.com or http://www.oracle.com/technetwork/java/javase/downloads/index.html. Use Java SE 6, Java SE 7 or later.
Download OMNeT++ source code (omnetpp-4.1-src-windows.zip) from http://omnetpp.org.
no: OMNeT++ 4.1 (source + IDE, tgz).
yes: OMNeT++ 4.1 win32 (source + IDE + MINGW, zip). Download this one. Do not use OMNeT++ v4.2.1 or later. You can not build inetmanet-20101013-src in OMNeT v4.2.1.
Extract the zip file to C drive. Rename the resulting directory to
omnetpp-4.1-rc2-src-windows.
Make sure your directory does not contain any space. For example, do not put OMNeT++ under Program Files.
Execute mingwenv.cmd in the omnetpp-4.1-rc2-src-windows directory by double-clicking it in Windows Explorer. It will bring up a console with the MSYS bash shell, where the path is already set to include the
omnetpp-4.1-rc2-src-windows\bin directory.
On the MSYS bash shell, enter the following commands:
$ ./configure
$ make
The build process with "make" will create both debug and release binaries.
On the MSYS bash shell, test all samples and check they run correctly. As an example, the dyna example is started by entering the following commands:
$ cd samples/dyna
$ ./dyna
If you get the error message, "Failed to create Java Virtual Machine." by double-clicking omnetpp.exe at C:\omnetpp-4.3\ide\omnetpp.exe with OMNeT++ v4.3, type the "$ omnetpp" in the mingwenv.cmd terminal to open OMNeT++ IDE. A better solution is by restart your PC before double-clicking the omnetpp.exe executable file.
OMNeT++ comes with an Eclipse-based Simulation IDE. You should be able to start the OMNeT++ IDE by double-clicking C:\omnetpp-4.1-rc2-src-windows\ide\omnetpp.exe.
It is recommended that you create a shortcut on the desktop for starting the OMNeT++ IDE by right-click omnetpp.exe program in the omnetpp-4.1/ide directory and choose Send To > Desktop (create shortcut) from the menu. On Windows 7, you can right-click the taskbar icon while the IDE is running, and select Pin this program to taskbar from the context menu.
Set OMNeT++ Workspace: C:\omnetpp-4.1-rc2-src-windows\samples.
Many projects for you to test from the samples folder.
[Ticked] Use this as the default and do not ask again.
Click "Workbench" icon from the Welcome page.
Open any project from the IDE Project Explorer window, right-click omnetpp.ini file and select Run As OMNeT++ simulation.
Notes
RC = release candidate.
OMNeT++ = Objective Modular Network Testbed in C++.
OMNeST = Objective Modular Network and Sensor Testbed in C++ (not sure).
opp = OMNeT++.
NeD = Network Description.
NeD Abbreviations and its Full Form
annotation / metadata annotation / NeD property / property
PER = packet error rate
BER = bit error rate
eed = end-to-end delay
ls = line style and color
t = text
tt = tooltip
m = connection routing orientation, positioning
b = object border, shape, colo
i = icon
is = icon size
Download OMNeT++ source code (omnetpp-4.1-src-windows.zip) from http://omnetpp.org.
no: OMNeT++ 4.1 (source + IDE, tgz).
yes: OMNeT++ 4.1 win32 (source + IDE + MINGW, zip). Download this one. Do not use OMNeT++ v4.2.1 or later. You can not build inetmanet-20101013-src in OMNeT v4.2.1.
Extract the zip file to C drive. Rename the resulting directory to
omnetpp-4.1-rc2-src-windows.
Make sure your directory does not contain any space. For example, do not put OMNeT++ under Program Files.
Execute mingwenv.cmd in the omnetpp-4.1-rc2-src-windows directory by double-clicking it in Windows Explorer. It will bring up a console with the MSYS bash shell, where the path is already set to include the
omnetpp-4.1-rc2-src-windows\bin directory.
On the MSYS bash shell, enter the following commands:
$ ./configure
$ make
The build process with "make" will create both debug and release binaries.
On the MSYS bash shell, test all samples and check they run correctly. As an example, the dyna example is started by entering the following commands:
$ cd samples/dyna
$ ./dyna
If you get the error message, "Failed to create Java Virtual Machine." by double-clicking omnetpp.exe at C:\omnetpp-4.3\ide\omnetpp.exe with OMNeT++ v4.3, type the "$ omnetpp" in the mingwenv.cmd terminal to open OMNeT++ IDE. A better solution is by restart your PC before double-clicking the omnetpp.exe executable file.
OMNeT++ comes with an Eclipse-based Simulation IDE. You should be able to start the OMNeT++ IDE by double-clicking C:\omnetpp-4.1-rc2-src-windows\ide\omnetpp.exe.
It is recommended that you create a shortcut on the desktop for starting the OMNeT++ IDE by right-click omnetpp.exe program in the omnetpp-4.1/ide directory and choose Send To > Desktop (create shortcut) from the menu. On Windows 7, you can right-click the taskbar icon while the IDE is running, and select Pin this program to taskbar from the context menu.
Set OMNeT++ Workspace: C:\omnetpp-4.1-rc2-src-windows\samples.
Many projects for you to test from the samples folder.
[Ticked] Use this as the default and do not ask again.
Click "Workbench" icon from the Welcome page.
Open any project from the IDE Project Explorer window, right-click omnetpp.ini file and select Run As OMNeT++ simulation.
Notes
RC = release candidate.
OMNeT++ = Objective Modular Network Testbed in C++.
OMNeST = Objective Modular Network and Sensor Testbed in C++ (not sure).
opp = OMNeT++.
NeD = Network Description.
NeD Abbreviations and its Full Form
annotation / metadata annotation / NeD property / property
PER = packet error rate
BER = bit error rate
eed = end-to-end delay
ls = line style and color
t = text
tt = tooltip
m = connection routing orientation, positioning
b = object border, shape, colo
i = icon
is = icon size
Saturday
DiGi Super Long Life RM30 (365 days) Activation, DiGi prepaid hit RM1, FnF list, Birthday bonus 50% more, free credit balance retrieval, unlimited mobile internet
DiGi Super Long Life is a feature where you can extend your
talktime validity to 1 year for just RM30. Indirectly, the subscription fee is RM2.50
per month to stay connected.
If you can’t activate DiGi Super Long Life RM30(365 days), change
your DiGi Prepaid Plus plan to DiGi’s latest plan which is DiGi Prepaid(Hit
RM1).
DiGi Prepaid(Hit RM1) plan allows you to enjoy lower call
and SMS rates to your 15 favourite numbers (11 DiGi numbers, 4 non-DiGi numbers).
Friends and Family
|
Standard Rates (to all local networks)
|
|
Voice & Video Calls
|
15sen/min
(12sen/min after usage of RM1/day)
|
36 sen/min
(12sen/min after usage of RM1/day)
|
SMS Rate DiGi to DiGi numbers
|
1sen / SMS (DiGi numbers)
|
10sen / SMS
(1sen /SMS after usage of RM1/day)
|
SMS Rate DiGi to Non-DiGi numbers
|
10sen / SMS (Non-DiGi
numbers)
|
|
MMS Rate DiGi to DiGi numbers
|
10sen / MMS (DiGi numbers)
|
25sen / MMS (DiGi numbers)
|
MMS Rate DiGi to Non-DiGi numbers
|
25sen / MMS (Non-DiGi
numbers)
|
|
Charging Block
Before hitting RM1
|
18sen / 30 seconds
|
|
Charging Block
After hitting RM1
|
12sen / 60 seconds
|
Changes to FnF list:
6 complimentary changes allowed, 3 DiGi + 3 non-DiGi numbers.
Subsequent revisions will cost RM2 fee per change.
To change call plan via Online Customer Service (OCS):
Step 1: Login to OCS at http://www.digi.com.my.
Step 2: Select LHS Menu | My Account | Change Call Plan |
DiGi prepaid.
Step 3: Select [Yes] to confirm and a one-off fee of RM3.00 will
be charged to your account.
Notes:
You are allowed to change call plan once a month.
If your previous call plan/subscription has FnF numbers from
other network operators, these FnF numbers will be removed once change is
successful.
Received SMS from DiGi 2900. 2011: Welcome to
DiGi_PrepaidRM1_. This change cost: RM3:00.
Birthday Bonus 50% more:
You will get 50% more credit for every reload you make on
any day of the week.
The Birthday Bonus period lasts for one week, starting from
3 days before your birthday to 3 days after your birthday.
The Birthday Bonus has a maximum cap of RM500 in reloads
made during the registered birthday week.
Maximum birthday bonus rewards is RM250 every calendar year.
To activate DiGi Super Long Life via *128#:
Step 1: You must have at least RM35 in your account.
Step 2: Dial *128# and then press call.
Step 3: Reply 1 for My Account.
Step 4: Reply 7 for Talktime Services.
Step 3: Reply 1 for My Account.
Step 4: Reply 7 for Talktime Services.
Step 5: Reply 3 for Super Long Life.
Step 6: Reply 2 for Super Long Life RM30 (365 days). Be careful. Do not send 1 unless you really want RM5 for 30 days only.
Step 7: Press 1 to confirm that you have selected RM30.00
with 365 days validity.
Notes:
Thank you for choosing Super Long Life. You now have one
less thing to worry about
for the next 365 days!
Received a confirmation SMS from Digi 2900. Your validity
purchase of 365 days for RM30.00 is successful. Your new date of expiry is XX/XX/2013.
This feature is available for DiGi Prepaid(Hit RM1)
subscribers only.
Free Credit Balance Retrieval:
Free Credit Balance Retrieval:
Dial *126# to find out how much talktime you have.
Auto Balance Notification:
SMS notifications sent to you after each call to let you
know how much talktime you have left.
90 Days Incoming Calls:
Receive incoming calls for 90 days even though your reload
validity has expired.
DiGi Helpline contact is +6016 22 11 800.
Reload coupons. You can buy and reload as many coupons as
you want.
Available in
|
How long it lasts
|
RM10
|
10 days
|
RM20
|
20 days
|
RM30
|
30 days
|
RM50
|
50 days
|
RM100
|
120 days (~4 months)
|
Try not to take any call while travelling overseas. You will
incur expensive roaming charges.
Using your mobile phone in places other than its home area
is called roaming.
Main credit balance is capped at RM25,000. Customers will
not be able to perform any reload nor extend their validity once this amount is
reached.
Mobile 3G Prepaid Internet:
DiGi 3G Prepaid offers cheap and easy Internet access on
your mobile phone.
10sen/10kb. Max RM5 daily.
The average size of email is 10kb-30kb, webpage 100kb-500kb,
and 1 minute YouTube video 2.5MB.
Unlimited mobile internet for only RM15 per week from the
day you subscribe.
Around RM2.15 per day.
Turbo 3G Speed at 384kbps. Weekly quota is 250MB. Please
take note that your subscription will be auto-renewed after it expires.
To subscribe to mobile internet unlimited RM15/week via
*116#:
Step 1: Dial *116# and press call.
Step 2: Reply 1 to choose Internet Unlimited 15.
Step 3: Reply 1 to confirm.
To unsubscribe, you may use the same channel as above.
Subscribe to:
Posts (Atom)
If a hater attacked your age and not the goodness of you
Whether young or old, I've always been known what endures. I've known the very idea of people that were all created equal and deserv...
-
DiGi Super Long Life is a feature where you can extend your talktime validity to 1 year for just RM38. Indirectly, the subscription fee is ...
-
Open LibreOffice Draw program. Select the rectangle shape from shape toolbar at the bottom of drawing page. Click a point and drag-and-re...
-
DiGi Super Long Life is a feature where you can extend your talktime validity to 1 year for just RM30. Indirectly, the subscription fee is...