Showing posts with label line. Show all posts
Showing posts with label line. Show all posts

Friday, July 21, 2017

Deleting a remote branch using command line Git

Deleting a remote branch using command line Git


If you are familiar with GitHub UI after browsing branches tab you can simply delete a branch(If you have relevant permissions).


Lets see how we do the same using command line.
git push <REMOTE_NAME> :<BRANCH_NAME>
Note the space between remote name and the colon. By following this syntax you are asking git to push nothing hence git push will delete the branch in remote repository.

Eg:-
udara@udara-home:~/workspace/h2-social-adaptor$ git push origin :v2
To git@github.com:udarakr/h2-social-adaptor.git
 - [deleted]         v2

Read more »

Sunday, June 11, 2017

DDA Line Drawing Algorithm

DDA Line Drawing Algorithm



PROGRAM:
using namespace std;
#include<iostream>
#include<graphics.h>
#include<math.h>

class DDALINE
{
    int xmid,ymid;

    float x1,y1,x2,y2;
public :
    void quad();
    void simple(float,float,float,float);
    void dot(float,float,float,float);
    void dash(float,float,float,float);
    void dashdot(float,float,float,float);
    void thick(float,float,float,float,int);

};

void DDALINE :: quad()
{
    int xmax=640,ymax=480;
    int gd=DETECT,gm;
    initgraph(&gd,&gm,NULL);
    xmid=xmax/2;
    ymid=ymax/2;
    line(0,ymid,xmax,ymid);
    line(xmid,0,xmid,ymax);
}

void DDALINE :: simple(float x1,float y1,float x2,float y2)
{
    int i,steps;
    float dx,dy,xinc,yinc;
    dx=x2-x1;
    dy=y2-y1 ;

    if(dx<dy)
    {
        steps=abs(dy);
    }
    else
    {
        steps=abs(dx);
    }
    xinc=(x2-x1)/steps;
    yinc=(y2-y1)/steps;
    putpixel(x1,y1,15);
    for(i=1;i<=steps;i++)
                {
                x1=x1+xinc;
                y1=y1+yinc;
                       putpixel(x1,y1,18);
              }
}
     
void DDALINE :: dot(float x1,float y1,float x2,float y2)
{
int i,steps;
    float dx,dy,xinc,yinc;

    dx=x2-x1;
    dy=y2-y1 ;

    if(dx<dy)
    {
        steps=abs(dy);
    }
    else
    {
        steps=abs(dx);
    }

    xinc=(x2-x1)/steps;
    yinc=(y2-y1)/steps;
    putpixel(x1,y1,15);
    for(i=1;i<=steps;i++)
                {
                x1=x1+xinc;
                y1=y1+yinc;
    if(i%2==0)                     
    {putpixel(x1,y1,18);}
              }  

}

void DDALINE :: dash(float x1,float y1,float x2,float y2)
{
    int i,steps;
    float dx,dy,xinc,yinc;
    dx=x2-x1;
    dy=y2-y1 ;
    if(dx<dy)
    {
        steps=abs(dy);
    }
    else
    {
        steps=abs(dx);
    }

    xinc=(x2-x1)/steps;
    yinc=(y2-y1)/steps;
    putpixel(x1,y1,15);
    for(i=1;i<=steps;i++)
                {
                x1=x1+xinc;
                y1=y1+yinc;
    if(i%5<3)                     
    {putpixel(x1,y1,18);}
              }  

}

void DDALINE :: dashdot(float x1,float y1,float x2,float y2)
{
    int i,steps;
    float dx,dy,xinc,yinc;
    dx=x2-x1;
    dy=y2-y1 ;
    if(dx<dy)
    {
        steps=abs(dy);
    }
    else
    {
        steps=abs(dx);
    }
    xinc=(x2-x1)/steps;
    yinc=(y2-y1)/steps;
    putpixel(x1,y1,15);
    for(i=1;i<=steps;i++)
                {
                x1=x1+xinc;
                y1=y1+yinc;
                if(i%6<3 || i%6==4)                     
                {putpixel(x1,y1,18);}
              }  

}

void DDALINE :: thick(float x1,float y1,float x2,float y2,int t)
{
    int i,j,steps;
    float dx,dy,xinc,yinc;
    dx=x2-x1;
    dy=y2-y1 ;
    if(dx<dy)
    {
        steps=abs(dy);
    }
    else
    {
        steps=abs(dx);
    }
    xinc=(x2-x1)/steps;
    yinc=(y2-y1)/steps;
    putpixel(x1,y1,15);
    for(i=1;i<=steps;i++)
                {
                x1=x1+xinc;
                y1=y1+yinc;
                for(j=0;j<t;j++)                     
                {putpixel(x1,y1+j,18);}
              }  

}



int main()
{
    int gd=DETECT,gm;
    float x1,y1,x2,y2;
    int ans, ch,t;
    DDALINE p;
    do
    {
        cout<<" Enter X1 : ";
        cin>>x1;
        cout<<" Enter Y1 : ";
        cin>>y1;
        cout<<" Enter X2 : ";
        cin>>x2;
        cout<<" Enter Y2 : ";
        cin>>y2;
        x1=x1+320;
        y1=240-y1;
        x2=x2+320;
        y2=240-y2;
      cout<<" Menu:";
      cout<<" 1.Simple line 2.Dashed line 3.Dotted line 4.Center line 5.thick";
      cout<<" Enter choice : ";
      cin>>ch;
      switch(ch)
      {

          case 1:
        p.quad();
        p.simple(x1,y1,x2,y2);  
         break;
         case 2:
        p.quad();
        p.dash(x1,y1,x2,y2);           
        break;
        case 3:
        p.quad();
        p.dot(x1,y1,x2,y2);
         break;
        case 4:
        p.quad();
        p.dashdot(x1,y1,x2,y2);
              break;
        case 5:
        printf(" Enter the thick ness of line");      
        scanf("%d",&t);
        p.quad();
        p.thick(x1,y1,x2,y2,t);
              break;
    }      
    getch();  
    closegraph();
        cout<<"Do You Want To Continue : ";
        cin>>ans;
    getch();  
    closegraph();
    }while(ans==1);
    getch();
    return 0;
}
Read more »

Monday, April 24, 2017

Deploying applications or libraries to WebLogic Server using command line

Deploying applications or libraries to WebLogic Server using command line


Here is how you can automate deployment for WebLogic server using command line.

First source the env settings from the server:
$ source $ML_HOME/server/bin/setWLSEnv.sh

Deploy Library:
$ java weblogic.Deployer -nostage -deploy -library
-adminurl localhost:7001
-username weblogic -password my_secret
-targets myserver
my_shared_lib.war


Deploy Application:
$ java weblogic.Deployer -nostage -deploy
-adminurl localhost:7001
-username weblogic -password my_secret
-targets myserver
-name myapp.war myapp.war


For development, you likely want to use the "-nostage" meaning to deploy the app or library directly from the file system. This means any changes to that file location and a reload from WLS will take effect immediately.

For undeploy the command line options are same for library or app but with matching name.
$ java weblogic.Deployer -undeploy
-adminurl localhost:7001
-username weblogic -password my_secret
-targets myserver
-name myapp_or_lib.war
Read more »

Sunday, April 2, 2017

Dell lancia una nuova line up di portatili e un all in one con Ubuntu

Dell lancia una nuova line up di portatili e un all in one con Ubuntu


Dell Precision 5720 all-in-one

Dell ha annunciato lampliamento della sua line-up di workstation mobile Precision basata su Ubuntu alla quale si aggiunge per la prima volta il Precision 5720 All-in-One. I nuovi prodotti saranno disponibili a partire da Febbraio negli USA e successivamente nel resto del mondo.
Ecco i nuovi prodotti:

  • Dell Precision 3520, mobile workstation (disponibile da subito negli USA)
  • Dell Precision 5520, mobile workstation (disponibilit� non ancora comunicata)
  • Dell Precision 7520, mobile workstation (disponibile dal 28 Febbraio 2107 negli USA)
  • Dell Precision 7720, mobile workstation (disponibile dal 28 Febbraio 2107 negli USA)
  • Dell Precision 5720, all-in-one (disponibile dal 6 Aprile 2107 negli USA)

Tutti i sistemi saranno equipaggiati con Ubuntu 16.04 LTS e sono caratterizzati da processori di settima generazione Intel� Core� e Intel� Xeon� e avranno il supporto Thunderbolt 3.

Di seguito le caratteristiche complete:

Dell� Precision 3520, mobile workstation
Affordable, fully customizable 15� mobile workstation
Key features
  • Preloaded with Ubuntu 16.04 LTS
  • 7th generation Intel� Core� and Intel� Xeon� processors
  • 15.6� HD (1366�768), FHD (1920�1080) and FHD touch
  • Up to 32GB of memory and 2TB of storage
  • ECC memory, Thunderbolt 3 and NVIDIA graphics
  • Availability: worldwide

Dell Precision 5520, mobile workstation  �  Coming soon
World�s thinnest and lightest 15� mobile workstation
Key features
  • Preloaded with Ubuntu 16.04 LTS
  • 7th generation Intel� Core� and Intel� Xeon� processors
  • 15.6� UltraSharp� FHD (1920�1080) or UltraSharp� UHD (3840�2160)
  • Up to 32GB of memory and 2TB of storage
  • Thunderbolt 3
  • NVIDIA Quadro graphics
  • Availability: worldwide

Dell Precision 7520, mobile workstation � Available Feb 28 in US
World�s most powerful 15� mobile workstation
Key features
  • Preloaded with Ubuntu 16.04 LTS
  • 7th generation Intel� Core� and Intel� Xeon� processors
  • 15.6� FHD (1920�1080), UltraSharp� FHD (1920�1080) both Touch and Non-Touch, UltraSharp� UHD (3840�2160)
  • Up to 64GB of memory and 3TB of storage
  • Thunderbolt 3
  • NVIDIA Quadro� and Radeon Pro� graphics options
  • Availability: worldwide

Dell Precision 7720, mobile workstation � Available Feb 28 in US
World�s most powerful mobile workstation
Key features
  • Preloaded with Ubuntu 16.04 LTS
  • 7th generation Intel� Core� and Intel� Xeon� processors
  • 17.3� HD+ (1600�900), UltraSharp� FHD (1920�1080) or UltraSharp� UHD (3840�2160)
  • Up to 64GB of memory and 4TB of storage
  • Thunderbolt 3
  • NVIDIA Quadro� and Radeon Pro� graphics options
  • Availability: worldwide

Dell Precision 5720, All-in-One � Available April 6
27� All-in-One workstation class machine
Key features
  • Preloaded with Ubuntu 16.04 LTS
  • 7th generation Intel� Core� and Intel� Xeon� processors
  • 27� UltraSharp� UHD (3840�2160) both touch and non-touch
  • Up to 64GB of memory and Up to (1) M.2 PCIe SSD and up to (2) 2.5� SATA
  • Thunderbolt 3
  • Radeon Pro� graphics
  • Availability: worldwide
Via Bartons Blog
Read more »