Friday, May 12, 2017

Fixing WinEdit MDI event handler macros error.

Environment
     OS: Windows 7 32bit
     WinEdit v5.4 (build: 20050201)

Error :

   

Possible Reason: 
     Either the path mentioned is wrong OR the macro file "MDIOpen.edt" is accidentally deleted.

How to Fix this Issue?
 Follow below steps

1.  Open WinEdit 5.4 program.
2.  Go to "Options" menu and select "Preferences" submenu.
3.  Click on "MDI Events" tab.

4.  Now check all four paths. The directory of all files (MDIOpen-Before.edt, MDIOpen.edt, MDIActivate.edt and MDISave.edt) must be same.

Here %b represent "C:\Program Files\WinEdt Team\WinEdt" path.
Now let's check two directories:
                 First  "C:\Program Files\WinEdt Team\WinEdt\Macros"
                 Second: "C:\Program Files\WinEdt Team\WinEdt\Macros\Events"

First Directory  "C:\Program Files\WinEdt Team\WinEdt\Macros ": 

Second Directory: "C:\Program Files\WinEdt Team\WinEdt\Macros\Events"


Now it is clear that the path in  MDI Events preference is WRONG.

5. Change the path from "[Exe("%b\Macros\MDIOpen.edt");]"  to "[Exe("%b\Macros\Events\MDIOpen.edt");]".


6. Now, restart the WinEdit program. Hope the error is fixed.

Let me know in the comment section if the error is NOT fixed.

-Thank you





Friday, April 28, 2017

What is Fat Tree and how to construct it in 4-steps ?

Fat tree network topology looks like a tree topology like below example. In tree topology, we have same terminologies like Root, parent, child etc.  This is mainly used to connect a large number of physical servers/ computers in a large data center.
Fig-1. An example of tree network topology


It is recommended that reader should go through the basics of cloud computing and data center first.

In the tree structure topology, leaf nodes are physical servers or computers. Rest other nodes are switches.

Switches are basically 3 types: Core switches, Aggregation switches, and Edge switches.
Servers can be heterogeneous in terms of their configurations.

Fat tree topology is based on the complete binary tree. Below is an example of 3 layer Fat tree topology. The top layer (level-0) of switches is called Core layer. The second layer of switches is called Aggregation layer. And the third layer of switches is called Edge layer. The number of ports in each switch is same.

Fig-2. An example of 3 layer Fat tree topology.
Now let's construct a Fat tree network.
The information we need is the number of ports present in each switch. Let k be the number of ports that each switch contains. Switches with k number of ports in a Fat tree topology is called k-ary or k-port Fat tree network topology.
From the value of k, we’ll derive the number of core switches, aggregation switches, edge switches and the maximum number of servers that can be attached.
A set of (k/2) number of aggregation switches and (k/2) number of edge switches are combined together and that is known as a Pod.

Example - 1:

Let k=4, i.e. each switch has 4 ports.

Step-1:                                          
    Number of core switches is (k/2)^2 = 4 core switches.  If the value of k=8, we need (8/2)^2=16 core switches.
    Number of pods = k = 4.
Fig-3. Step-1 of Fat tree construction

Step-2:                                          
    Each pod consists of (k/2)=(4/2)=2 aggregation switches and (k/2)=(4/2)=2 edge switches.
    The switches are organized in layer wise. First layer is aggregation layer. Second layer is edge layer.
Fig-4. Step-2 of Fat tree construction


Step-3:                                          
    Each aggregation switch within a pod is connected to (k/2)=(4/2)=2 core switches and (k/2)=(4/2)=2 edge switches.
Fig-5. Step-3 of Fat tree construction

Step-4:                                          
    Each edge switch within a pod is connected to (k/2)=(4/2)=2 servers and (k/2)=(4/2)=2 aggregation switches. That means each pod will be connected to (k/2)^2=(4/2)^2=4 servers.
    Hence the maximum number of servers that can be connected to the network is (k^3)/4=16 servers.
Fig-6. Step-4 of Fat tree construction





Example - 2:

If the value of k=8, each switch has 8-ports.
Step-1:                                           
    Number of core switches is (k/2)^2 = 16 core switches.
    Number of pods = k = 8.

Step-2:                                           
    Each pod consists of (k/2)=(8/2)=4 aggregation switches and (k/2)=(8/2)=4 edge switches.
    The switches are organized in layer wise. First layer is aggregation layer. Second layer is edge layer.
  
Step-3:                                          
    Each aggregation switch within a pod is connected to (k/2)=(8/2)=4 core switches and (k/2)=(8/2)=2 edge switches.

Step-4:                                          
    Each edge switch within a pod is connected to (k/2)=(8/2)=4 servers and (k/2)=(8/2)=4 aggregation switches. That means each pod will be connected to (k/2)^2=(8/2)^2=16 servers.
    Hence the maximum number of servers that can be connected to the network is (k^3)/4=128 servers.


Thats all for now.
Please comment if you need more information.



-Thank you

Tuesday, April 11, 2017

Creating and customizing 3D graph in MATLAB.

Unlike 2D figure, 3 variables are involved in a 3D figure. Below is an example of 3D mesh graph. For certain value of X and Y, we plot the value of Z.
Example :
        Z = (X  /  (c*Y))
3D figure can be bar, mess, surf etc...

Let's begin drawing the graph for the equation
        Z = (X  /  (c*Y))

Step-1: Prepare the data

X = [0.1000    0.1889    0.2778    0.3667    0.4556    0.5444    0.6333    0.7222    0.8111    0.9000]
Y = [-0.1000   -0.1889   -0.2778   -0.3667   -0.4556   -0.5444   -0.6333   -0.7222   -0.8111   -0.9000]
c = 0.05

Here I have used the following Matlab code to generate the data for X and Y.
X = linspace(0.1,0.9,10)
Y = linspace(-0.1,-0.9,10)

for X, 0.1 is the initial value, 0.9 is the final value, and 10 is the number of values to be generated between initial and final value. Similarly for Y also. 


Now In order to generate the data for 3D surf convert X and Y data to a meshgrid.
Step-2: 
           [mx, my] = meshgrid(X, Y);

Step-3: Generate data for Z-axis
           Z = mx ./ (c.*my);

Step-4: Get ready to plot the data onto a 3D figure.

Enter the following code


figure1 = figure();

% Create axes
axes1 = axes('Parent',figure1);
hold(axes1,'on');
% Create xlabel
xlabel('X-axis Label');

% Create ylabel
ylabel('Y-axis Label');

% Create zlabel
zlabel('Z-axis Label');

view(axes1,[152.1 22]);


% Create surf
surf(ax,ay,Z,'Parent',axes1);

grid(axes1,'on');

% Set the remaining axes properties
set(axes1,'FontName','Times New Roman','FontSize',14,'FontWeight','bold',...
    'XTick',[0.1 0.3 0.5 0.7 0.9],'XTickLabel',...
    {'0.1','0.3','0.5','0.7','0.9'});

Final Step:
The entire Matlab file will look like this

X=linspace(0.1,0.9,10);
Y=linspace(-0.1,-0.9,10);
c=0.05;

[ax, ay] = meshgrid(X,Y);
Z = ax ./(c.*ay);

figure1 = figure();

% Create axes
axes1 = axes('Parent',figure1);
hold(axes1,'on');
% Create xlabel
xlabel('X-axis Label');

% Create ylabel
ylabel('Y-axis Label');

% Create zlabel
zlabel('Z-axis Label');

view(axes1,[152.1 22]);


% Create surf
surf(ax,ay,Z,'Parent',axes1);

grid(axes1,'on');

% Set the remaining axes properties
set(axes1,'FontName','Times New Roman','FontSize',14,'FontWeight','bold',...
    'XTick',[0.1 0.3 0.5 0.7 0.9],'XTickLabel',...
    {'0.1','0.3','0.5','0.7','0.9'});


Bonus tips: Customizing the axis label with text() and annotation().

Disable xlabel(), ylabel(), and zlabel() if you are going for text() or annotation() command.

text() example:
% After running this .m file edit the position of each text box
   ty=text(0.5,0.5,'Y-axis label','Rotation',-28,'FontSize',20,...
    'FontWeight','bold','FontName','Times New Roman');

annotation() example:

  annotation(figure1,'textbox',...
     [0.528242677824266 0.789163935354498 0.0753138055985942 0.0475409826782883],...
     'String',{'? = 0.5'},...
     'FontWeight','bold',...
     'FontSize',12,...
     'FontName','Times New Roman',...
     'EdgeColor',[0.24705882370472 0.24705882370472 0.24705882370472],...
     'BackgroundColor',[1 1 1]);

Thats all for now. 
Please comment if more customization function you need.


Thank you


Thursday, November 24, 2016

Installing packages (Python, R and Scala) with Anaconda.

Anaconda makes the package management of Python, R and Scala very easy. For this you need to have Anaconda-navigator package installed in your computer.



1. Open Command prompt
2. Enter conda install anaconda-navigator
3. Press Enter key to proceed.

Now open anaconda navigator application. Below is the Home screen of Anaconda navigator.
1. Home Screen


Click on Environments, as shown below
2. Environment screen


Change the Installed option to All option Select
3. Change "Installed" to "All" option

4. Differentiate "Installed", "Not installed" and "Upgradable " packages.

Now Type the required package in the Search box.
Lets install "pandasql" package . So type pandasql in the search box. Now you can see the search result.

5. Search required package


Now right click on the checkbox in the respective search result. From the options , select "Mark for installation"

6. Installation option


Click on "Apply" button.
Now click on "Ok" button.
7. Final steps.


Its finish. Repeat the same process for installing other packages.




Installing Anaconda in Windows OS.


Step 1: Download
First step is to download the latest version of Anaconda for Windows OS.

For Windows 64bit (Python 3.5): https://repo.continuum.io/archive/Anaconda3-4.2.0-Windows-x86_64.exe
For Windows 32bit (Python 3.5):  https://repo.continuum.io/archive/Anaconda3-4.2.0-Windows-x86.exe

For Windows 64bit (Python 2.7): https://repo.continuum.io/archive/Anaconda2-4.2.0-Windows-x86_64.exe
For Windows 32bit (Python 2.7):  https://repo.continuum.io/archive/Anaconda2-4.2.0-Windows-x86.exe

You can also download from official link https://www.continuum.io/downloads.

Step 2 : Install
Install Anaconda 3.5 (Python 3.5)
  1. Double click on the downloaded file.
  2. Follow the wizard.
  3. Select "Just me..." option, and click on "Next" button.
  4. In the "Advanced Installation Options", please make sure that "Add Anaconda to my PATH...." and "Register Anaconda....."  options are checked.
  5. now just follow the wizard and finish the installation process.

Step 3: Verify the installation
Open command prompt
Enter following command
 conda --version

Monday, October 31, 2016

Installing and running the docker daemon remotely.

Step-1: Installing the Docker
         sudo apt-get install docker.io
After installing, docker will start running automatically.
Step -2: Stoping the docker
         sudo service docker stop

Step-3: configuring the docker
  
sudo docker -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -d &
This will make the docker daemon to listen through unix socket and the TCP port


Now access the docker daemon 
example-1
  docker -H=tcp://120.126.17.39:2375 run ubuntu


example-2
   docker run ubuntu

example-3
  docker -H=tcp://120.126.17.39:2375 ps -a


example-4
    docker ps -a


For uninstalling use following command
  sudo apt-get purge --auto-remove docker.io
 



When docker-engine is install, I found the command is slightly different from the previous one.
To install docker-engine:  [src]
        sudo apt-get install docker-engine
Stop the docker:
        sudo service docker stop
Following command will enable the docker to listen using both Linux socket and tcp:
          sudo dockerd -H unix:///var/run/docker.sock H tcp://0.0.0.0:2375
Now to access docker daemon:
          sudo docker -H tcp://0.0.0.0:2375 
                 or 
          sudo docker -H tcp://120.126.16.34:2375

tcp://120.126.16.34:2375 is the IP of the daemon host. The IP of daemon host can be different based on your configuration.

Thursday, October 27, 2016

Which port is opened in my Linux system ?

netstat command can be used to know all ports opened currently.

command 

netstat  <option>

option:
-a                              short form of '--all'
-t or --tcp                  for tcp connection
-u or --udp                for udp connection
-n                              for numeric presentation

Example

netstat -atn                     for all tcp connection
netstat -aun                    for all udp connection

netstat -ltn                     for all ACTIVE tcp connections
netstat -lun                     for all ACTIVE udp connections

Friday, October 21, 2016

Uninstalling Docker-engine from Ubuntu 14.04

Completely Uninstalling Docker-engine including Configuration data and other dependencies

        sudo apt-get purge --auto-remove docker-engine

Uninstalling Docker and its dependencies

        sudo apt-get remove --auto-remove docker-engine

Uninstalling Docker and its configuration data

        sudo apt-get purge docker-engine

Uninstalling only Docker

        sudo apt-get remove docker-engine

Thursday, October 20, 2016

Accessing remote printer [Fuji Xerox DocuPrint m215b]

In this post we will see, how to access a shared remote printer. Below picture describes the concern environment.


Let's say you as the user want to access the printer attached to another computer which is connected to internet. Its assume that the printer is already shared. So this post is all about configuring the user's computer to access the remote printer.

Environment :

OS: Windows 8 (The steps may vary slightly in other versions of Windows)
Printer Driver: In this demonstration Fuji Xerox DocuPrint m215b is used.
                           Driver for Windows 64bit  OS
                            (Compatible OS: Windows 7, Windows 10, Windows Server 2003, Windows Server 2003 64bit, Windows Vista, Windows Vista 64bit, Windows Server 2008, Windows Server 2008 64bit, Windows Server 2008 R2, Windows 7 64bit, Windows 8, Windows 8 64bit, Windows 8.1, Windows 8.1 64bit, Windows Server 2012, Windows Server 2012 R2, Windows 10 64bit )
                             (Click here to download the driver from official website)



 Driver Installation steps



Step1:  Download the Printer driver
Step 2: Now extract the content of the downloaded driver. Open the newly created Folder.

Step 3: Right click on the application and click on "Run As Administrator"

Step 4: Click on Unzip

Step 5: Now you will see another folder. Now close the dialog box and open the newly created folder.

Step 6 :  Now run the "install" application by double clicking on it.

Step 7:  Select "Personal installation" radio button and click on next button.

Step 8:  Click on "next" button after accepting the license agreement.

Step 9: Now wait for few mins

Step 10 : Click on "Finish" button to finish the installation process.




Adding Remote printer



Step 1: Open the control panel, and click on "Devices and Printers"

Step 2:  Click on "Add a printer"

Step 3:  Wait for auto search. Or you can click on "The printer that I want isn't listed"

Step 4:  Give the printer name (including computer name) and click on "Next" button.

Step 5:  You must see the printer name. Click on "Next" button.

Step 6: Click on "Print a test page" to check the accessibility of the printer. click "Finish" button to finish the configuration process.


That's all for now...Please comment if you encounter any problem.

-Thank you





Thursday, October 6, 2016

Installing OpenCV and Python in Windows


1. Download and install Python 2.7.x in windows
             windows install : http://python.org/ftp/python/2.7.5/python-2.7.5.msi
2.  The default installation directory C:\Python27


3. Download and install python package manager pip if NOT installed
                  A. Download get-pip.py script from  https://bootstrap.pypa.io/get-pip.py
                  B. Open command prompt
                  C. Enter following command to run the downloaded script
                                    python <path to get-pip.py file>

4.  Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/ to download and install python packages

5.  Now, Download Numpy python package (choose the .whl file based on your requirement)
                  A. Open command prompt
                  B. Go to the local directory where numpy-1.11.2+mkl*.whl file is present
                  C. Enter following command to Install Numpy
                                    pip install numpy-1.11.2*.whl
6. You can repeat Step-5 to install other required packages


7. Download and install OpenCV
                  A. Folllow the link to download OpenCV-3.1.0
                  B. Open the .exe file to install (in C drive)
                  C. Goto C:\opencv\build\python
                  D. Copy cv2.d to C:\Python27\Lib\site-packages

Please comment if you encounter any error....

-Thank you