Tuesday 2 July 2013

Physibles

Physibles is a category for printing 3D objects.In the next few years with fast growing technology, physical replicas of objects could be made feasibly.
Since the transformation is taking place for Digital form into Physical form so the output or result is named as "PHYSIBLES"........(data objects that are able to become Physical).

Idea Originated from : 3D printers in action at CES 2012 (Maker Bot Replicator)

This technology allows for the printing of three-dimensional objects by melting and fusing bits of plastic, layer by layer. Things like toys, chess pieces, gears, artwork, cups, bowls, and more are already possible to “print” at home.

Long Term Objectives :
  • One could download a design file of anything imaginable and the 3D printer could create it.
  • Copying from Digital form into Physical form or Objects.

Things like 3D Printers, Scanners are just some of the First steps towards this technology...........!!

Advantages :
  • Efficient Transformation
  • Feasible management and control over elasticity, strength, rigidity of a material
  • Reuse,Recycle of unwanted Materials(Like plastics, toys, car, bike.....etc)
  • No more shipment of huge amount of products
  • No more shipping the broken products back
  • No more child labour
  • Reduction in Cost per Production
The Pirate Bay has Launched this 3D printing category...................PHYSIBLES.....!!

Monday 24 June 2013

MENU in C/C++

Program : NAVIGATIONAL MENU
Platform : Turbo C 3.0Description : It is a program to demonstrate the menu system in C/C++. It also uses navigation through ARROW keys..........!!

View or Download CPP


#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
int ch=1;

void menu();
void choice();

int main()
{
menu();
getch();
return 0;
}
////////////////////////////////
////////////////////////////////

void menu()
{
int gdriver = DETECT, gmode,i;

/* initialize graphics mode */
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
setcolor(2);
for(i=0;i<10;i++){rectangle(10+i,10+i,620+i,460+i);delay(50);}
setfillstyle(1,15);
bar(40,40,600,440);
settextstyle(7,0,5);
outtextxy(270,60,"MENU");
setcolor(4);
settextstyle(1,0,2);
/* 1 */
rectangle(180,145,450,180);
rectangle(185,147,445,178);
/* 2 */
rectangle(180,195,450,230);
rectangle(185,197,445,228);
/* 3 */
rectangle(180,245,450,280);
rectangle(185,247,445,278);
/* 4 */
rectangle(180,295,450,330);
rectangle(185,297,445,328);
/* 5 */
rectangle(180,345,450,380);
rectangle(185,347,445,378);
setcolor(1);
outtextxy(230,150,"1.EDUCATION");
outtextxy(230,200,"2.SPORTS");
outtextxy(230,250,"3.ENTERTAINMENT");
outtextxy(230,300,"4.POLITICS");
outtextxy(230,350,"5.EXIT");
setcolor(9);
rectangle(180,145,450,180);
rectangle(185,147,445,178);
choice();
}

//////////////////////////////////
//////////////////////////////////

void choice()
{
switch(getch())
 { case 'H':
    switch(ch)
   {
     case 2:setcolor(4);
    rectangle(180,195,450,230);
    rectangle(185,197,445,228);
    setcolor(9);
    rectangle(180,145,450,180);
    rectangle(185,147,445,178);
    ch--;
    choice();

     case 3:setcolor(4);
    rectangle(180,245,450,280);
    rectangle(185,247,445,278);
    setcolor(9);
    rectangle(180,195,450,230);
    rectangle(185,197,445,228);
    ch--;
    choice();

     case 4:setcolor(4);
    rectangle(180,295,450,330);
    rectangle(185,297,445,328);
    setcolor(9);
    rectangle(180,245,450,280);
    rectangle(185,247,445,278);
    ch--;
    choice();

     case 5:setcolor(4);
    rectangle(180,345,450,380);
    rectangle(185,347,445,378);
    setcolor(9);
    rectangle(180,295,450,330);
    rectangle(185,297,445,328);
    ch--;
    choice();

     default : choice();
   }

    break;
 case 'P':/*if(ch<5&&ch>=1){ch++;*/
    switch(ch)
   {
     case 1:setcolor(4);
    rectangle(180,145,450,180);
    rectangle(185,147,445,178);
    setcolor(9);
    rectangle(180,195,450,230);
    rectangle(185,197,445,228);
    ch++;
    choice();

     case 2:setcolor(4);
    rectangle(180,195,450,230);
    rectangle(185,197,445,228);
    setcolor(9);
    rectangle(180,245,450,280);
    rectangle(185,247,445,278);
    ch++;
    choice();

     case 3:setcolor(4);
    rectangle(180,245,450,280);
    rectangle(185,247,445,278);
    setcolor(9);
    rectangle(180,295,450,330);
    rectangle(185,297,445,328);
    ch++;
    choice();

     case 4:setcolor(4);
    rectangle(180,295,450,330);
    rectangle(185,297,445,328);
    setcolor(9);
    rectangle(180,345,450,380);
    rectangle(185,347,445,378);
    ch++;
    choice();

     default : choice();
   }

    /*}*/break;
   case 27: exit(0);
   case 13: switch(ch){
case 1:setcolor(MAGENTA);outtextxy(230,150,"1.EDUCATION");
      setcolor(3);outtextxy(200,400,"You selected EDUCATION");getch();exit(0);
case 2:setcolor(MAGENTA);outtextxy(230,200,"2.SPORTS");
      setcolor(3);outtextxy(200,400,"You selected SPORTS");getch();exit(0);
case 3:setcolor(MAGENTA);outtextxy(230,250,"3.ENTERTAINMENT");
      setcolor(3);outtextxy(200,400,"You selected ENTERTAINMENT");getch();exit(0);
case 4:setcolor(MAGENTA);outtextxy(230,300,"4.POLITICS");
      setcolor(3);outtextxy(200,400,"You selected POLITICS");getch();exit(0);
case 5:exit(0);
default : choice;
      }
   default : choice();
 }

}
/* Codetechie.blogspot.com */

Friday 21 June 2013

Code Complexity

Code Complexity is influenced by the factors :
  • Average Hierarchy Height
  • Average Number of Derived Classes
  • Afferent Coupling (no. of other packages that depend upon classes within a package )
  • Efferent Coupling ( no.of other packages that classes from this package depend upon )
  • Number of “if” condition statements and many more.........!
Cyclomatic Complexity (MCC)
It was developed by Thomas J. McCabe in 1976 and is used to indicate the complexity of a program. It directly measures the number of linearly independent paths through a program's source code.

Cyclomatic complexity is computed using the control flow graph of the program.
The cyclomatic complexity of a section of source code is the count of the number of linearly independent paths through the source code.
For ex : If the source code contained no decision points such as IF statements or FOR loops, the complexity would be 1, since there is only a single path through the code.
If the code had a single IF statement containing a single condition there would be two paths through the code, one path where the IF statement is evaluated as TRUE and one path where the IF statement is evaluated as FALSE.

Mathematically the complexity M is then defined as :
M = E − N + 2 P
where
E = no. of edges of the graph
N = no. of nodes of the graph
P = no. of connected components (exit nodes)

A simpler method of computing the MCC is demonstrated in the equation below. If D is the number of decision points in the program, then
M = D + 1 (Since, each decision point normally has two possible paths)

Some standard values of Cyclomatic Complexity are shown below:
M = D + 1
Assessment
1-10
not much risk
11-20
moderate risk
21-50   
high risk
51+
Not testable, very high risk

Thursday 20 June 2013

JAVA VS C++

  • C++ was designed for systems and applications programming
  • It is Write Once Compile Anywhere ( WOCA )
  • It Allows procedural programmingfunctional programmingobject-oriented programminggeneric programming, and template metaprogramming
  • It Runs as native executable machine code for the target instruction sets
  • It has multiple binary compatibility standards 
  • Pointers, references, and pass-by-value are supported for all types
  • Supports Single and Multiple inheritance of classes, including virtual inheritance
  • Java is a general-purpose, class-based, object-oriented computer programming language that is specifically designed to have as few implementation dependencies as possible
  • It is Write Once Run Anywhere / Everywhere ( WORA / WORE )
  • It strongly encourages exclusive use of the object-oriented programming paradigm. It also includes support for generic programming and creation of scripting languages
  • Runs in a virtual machine
  • It allows metaprogramming and dynamic code generation at runtime
  • It has a single, OS- and compiler-independent binary compatibility standard
  • All types (primitive and reference ) are always passed by value
  • It supports single inheritance of classes, and supports multiple inheritance through the Interfaces


Execution time for different Environment for Pentium PC ( Windows 95 )
Version
Execution Environment
Execution Time
Java array
Classic VM, JDK-1.2.2-001
81s

HotSpot VM 1.0.1 / Client VM 1.3beta-O
58s / 58s
Java Vector
HotSpot VM 1.0.1 / Client VM 1.3beta-O
216s / 215s
Java ArrayList
Client VM 1.3beta-O
166s
C++ pointer
MS Visual C++ 6.0
44s

Cygwin B20.1, egcs-2.91.57
19s
C++ object
MS Visual C++ 6.0
11s

Cygwin B20.1, egcs-2.91.57
16s
C++ vector
Cygwin B20.1, egcs-2.91.57
15s
C++ STL
Cygwin B20.1, egcs-2.91.57
11s