Tuesday, August 26, 2014

Drawing a self reference directed edge in graph

I come across a requirement to draw a self-reference edge in my graph on Raphael Graph.

The edge from inDirect to Direct is drawn using Bezier curve,
For the selef refernce edge as welli used the same Bazier curve,


Here P1 & P4 can be easily calculated as center point of each sides. and P2 & P3 are assumed to be the part of a square,
other wise we can get better value using angle and two point mathematical calculation in Geometry.

Hope it will help you draw better graphs and edges using Raphael and Mathematics.

Best,
Asker

Thursday, June 26, 2014

Installing OS in Raspberry Pi

As a fun project, I just purchased Raspberry Pi from Amazon costing $39.
Its look wonderful MicroController to do the All the automation project without having much knowledge in Electronic Circuits and designs, It is all about Software and programming with the documents from website.

For OS Installation you can refer to :

You can download OS NOODLE from following link.


As a Startup it looks better to use NOODLE as OS and you can specifically install any OS Inside.

Once you completed the Installation it will getback with command prompt:  startx

Wow the Screen Looks Awesome.
How to shutdown Pi :
You can Logoff in the UI and will get back to Command prompt:
There you can enter the follwoing command: sudo shutdown -h now


Thursday, May 15, 2014

How to check whether scrollbar available Using JQuery

In my Example I have a DIV contains some data Table.


As the application looks like Excel, I have to check whether the div have horizontal or Vertical Scrollbar present to set the size of other Div.




JQuery Code is as folows:

       if($('div.dataTableDiv').width()<$('#dataTable').width())
             console.log('Horizontal Scrollbar Present');
       else
             console.log('Horizontal Scrollbar NOT Present');


For Vertical Scrollbar:


       if($('div.dataTableDiv').height()<$('#dataTable').height())
             console.log('Vertical Scrollbar Present');
       else
             console.log('Vertical Scrollbar NOT Present');