Tuesday, March 24, 2020

Manjaro Linux

I am switching to Manjaro Linux ... But i have always a hidden love for Arch.
The main reason behind is stability. I need more stable system as well as rolling. (  :-) i am very lazy to recreate my Databasaes again and again and thus i rely on rolling Manjaro ) 

I am not using Gnome
1. It is less responsive. UI is suspended while copying files or other CPU intensive tasks.
2. Its design. WTF

KDE  and Cinnamon are my choices.
I think that cinnamon is the best replacement of KDE plasma.
It is not bloated , looks slim yet usable and powerful.

But one problem is that the DE cinnamon still not supports wayland.
Then i decide to use plasma , QT is free and licensed under both GPL(2) and LGPL(3). and gives more freedom than GTK+ (LGPL v2).





Sunday, February 18, 2018

SIMPLE CALCULATOR IN JAVA

About: 
 
Anyone can download and examin. This is free educational purpose program written in JDK9 (jdk9.openjdk ). You can help me by buying its PRO version which is capable to calculate GST also enriched with features.

Screenshot of the free Program --


Here is its code : 

/* A very simple calculator by Saurav Goswami <krishnasut@gmail.com>
* this is for Educational Purpose
* you can download and share data
* requirement - JDK9 and above
*/

import java.awt.* ;
import javax.swing.* ;
import java.awt.event.* ;

public class jcal {

  public static JFrame win ;
  public static JTextField tx ;
  public static JButton btplus ;
  public static JButton btminus ;
  public static JButton btdiv ;
  public static JButton btmul ;
  public static JButton bteq ;
  public static JButton btcls ;
  public static JButton btb ;
  public static JButton bta ;
  public static JButton btc ;
  public static JButton btd ;
  public static JButton bte ;
  public static JButton btf ;
  public static JButton btg ;
  public static JButton bth ;
  public static JButton bti ;
  public static JButton btj ;
 
  public static JButton btTobin ;
  public static JButton btTodec ;
 
 
  public static String num ;
  public static String operator ;
  public static int ans ;


   public static void main(String args[]) {
   num="" ;
   win = new JFrame("") ;
   win.setTitle("GANAK") ;
   win.setSize(500 , 200 ) ;
      //adding JTextField
         tx = new  JTextField("", 20  ) ;
         Font f = new Font("mono" , Font.BOLD ,  20) ;
         tx.setFont(f ) ;
        
        
         btplus = new JButton("+") ;
         btplus.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "," ;
         tx.setText(num) ;
         operator="+" ;
        
         }
        
        
         }) ;
         bta = new JButton("0") ;
         bta.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "0" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         btb = new JButton("1") ;
         btb.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "1" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         btc = new JButton("2") ;
         btc.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "2" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         btd = new JButton("3") ;
         btd.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "3" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         bte = new JButton("4") ;
         bte.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "4" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         btf = new JButton("5") ;
         btf.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "5" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         btg = new JButton("6") ;
         btg.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "6" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         bth = new JButton("7") ;
         bth.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "7" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         bti = new JButton("8") ;
         bti.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "8" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         btj = new JButton("9") ;
         btj.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "9" ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
        
         btminus = new JButton("-") ;
          btminus.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "," ;
         tx.setText(num) ;
         operator="-" ;
        
         }
        
        
         }) ;
         btmul = new JButton("*") ;
         btmul.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "," ;
         tx.setText(num) ;
         operator="x" ;
        
         }
        
        
         }) ;
         btdiv = new JButton("/") ;
         btdiv.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = num + "," ;
         tx.setText(num) ;
        
         }
        
        
         }) ;
         bteq = new JButton("=") ;
         bteq.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         System.out.println(num) ;
         String arr[] = num.split(",") ;
         int ln = arr.length ;
        
         if (operator.equals("+")  ) {
        
         //int ans = Integer.parseInt(arr[0]) + Integer.parseInt(arr[1])  ;
        
         
          for (int f=0 ; f < ln ; f++) {
            ans = ans+ Integer.parseInt(arr[f]) ;
         
         
          }
          tx.setText(ans+"") ;
         num="" ;
         ans=0 ;
         }
         if (operator.equals("-")  ) {
        
         int ans = Integer.parseInt(arr[0]) - Integer.parseInt(arr[1])  ;
         tx.setText(ans+"") ;
         
         num="" ;
         ans=0 ;
         }
        
         if (operator.equals("x")  ) {
         ans=1 ;
         //int ans = Integer.parseInt(arr[0]) * Integer.parseInt(arr[1])  ;
         for (int f=0 ; f < ln ; f++) {
            ans = ans* Integer.parseInt(arr[f]) ;
         
         
          }
         tx.setText(ans+"") ;
         
          num="" ;
         ans=0 ;
        
         }
         if (operator.equals("/")  ) {
        
         int ans = Integer.parseInt(arr[0]) / Integer.parseInt(arr[1])  ;
         tx.setText(ans+"") ;
         
          num="" ;
         ans=0 ;
        
         }
         }//
        
         }) ;
         btcls = new JButton("CE") ;
         btcls.setBackground(Color.ORANGE) ;
         btcls.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
        
         tx.setText("") ;
         num="" ;
         ans=0 ;
        
        
         }
        
        
         }) ;
        
         btTobin = new JButton("DEC2BIN") ;
         btTobin.setBackground(Color.GREEN) ;
        
         btTobin.addActionListener(new ActionListener() {
        
         public void actionPerformed(ActionEvent ee) {
         num = tx.getText() ;
         ans = Integer.parseInt(num) ;
         num = Integer.toBinaryString(ans);
         tx.setText(num + " ( BINARY )") ;
         num="" ;
        
         }
        
        
         });
        
         Container cc = new Container() ;
         cc.setLayout(new FlowLayout()) ;
        
         cc.add(tx) ;
        
         Container gg = new Container() ;
         gg.setLayout(new FlowLayout()) ;
        
        
         Container pp = new Container() ;
         pp.setLayout(new FlowLayout()) ;
        
         Container kk = new Container() ;
         kk.setLayout(new FlowLayout()) ;
        
         gg.add(bta) ;
         gg.add(btb) ;
         gg.add(btc) ;
         gg.add(btd) ;
         gg.add(bte) ;
        
         kk.add(btf) ;
         kk.add(btg) ;
         kk.add(bth) ;
         kk.add(bti) ;
         kk.add(btj) ;;
        
         pp.add(btplus) ;
         pp.add(btminus) ;
         pp.add(btmul) ;
         pp.add(btdiv) ;
         pp.add(bteq) ;
         pp.add(btcls) ;
         pp.add(btTobin) ;
        
        
         Container mm = new Container() ;
         mm.setLayout(new BoxLayout(mm , BoxLayout.Y_AXIS)) ;
        
        
        
         mm.add(cc) ;
         mm.add(gg) ;
         mm.add(kk) ;
         mm.add(pp) ;
         win.add(mm) ;
   

  
   win.setVisible(true) ;
   win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ; 
  

}}


This free version is limited and very simple. Please buy its pro version to help support me.

Friday, August 19, 2016

MAKE YOUR KDE 5 FASTER

When you are completing a serious task and constantly open and close several applications then  you need a faster Desktop Environment. Xfce4  is a an example. It is fast , stable and consumes little CPUs and Working memory. But in case of KDE which is "heavy" and gives us an opportunity to prove ourself not a "Dull People" it is a serious issue. By default KDE is pretty slow. When you are working , you don't need to view all fanciness of Glide or other effects ,In this tutorial , i share with you , how to make kDE 5 faster and usable.

first , create a hidden and empty directory in your $HOME and name it ~/.compose-cache. I experienced that this <a href="http://kdemonkey.blogspot.in/2008/04/magic-trick.html>magic trick </a> works fine. Now the instances  of your applications loads 50-150 ms faster.


Second , open Control Center and then Desktop Behavior. Now select Desktop Effects icon of the left side pane. All time consuming fancy effects such as Blur , Translucency which makes your KDE slow are shown in a list. Just disable them.


Third , fire up Control Center again and click on "Display and Monitor" icon of Hardware section. In this section , select Compositor option of the left side pane and makes animation speed "INSTANT" and select "Crisp" option listed in the drop down list to determine a faster scaling method.



Fourth , yes , disable the Splash Screen. We need a faster startup not a slow eye candy presentation at startup.


That's it. Hope this tutorial helps. If you have any suggestion please share and let us know.

Tuesday, July 12, 2016

COMPILE QT CODE

g++ -o code1 code1.cpp `pkg-config --libs --cflags Qt5Widgets` -fPIC
*PIC means platform independent code

it is almost same like --
gcc -o code code.c `pkg-config --cflags --libs gtk+-3.0 `


Tuesday, May 10, 2016

Add Color to Pacman Progressbar yEAh !!

Yes. You can add fancy color to your pacman. 
1. open /etc/pacman.conf
2. add following lines under [options] 

Color
ILoveCandy
 
Yep !! It's ready. :-)(-:  

Android-tools on Arch Linux

To install Fastboot and adb . open terminal and just type
pacman -S android-tools 

and now you are ready to work.

Manjaro Linux

I am switching to Manjaro Linux ... But i have always a hidden love for Arch. The main reason behind is stability. I need more stable syst...