Search the Blog

Monday, August 26, 2019

Pyhtan * Pattern Program with Space

As all of us knows that as we used to print the pattern program in C, C++, JAVA,Net, etc. to make comfortable to the new user as we started learning that programming language.

In the same way to make confidence and learn syntax and logic writting style in Python. We can practice as many prgram for this i am showing to all of you more than 20 pattern program code in Python.
You can copy and paste these code and even test at your own system. Users can modify these Codes too.

Python pattern program with space and Star(*) 

Pyhtan * Pattern Program with Space

Program Code-


def python_pattern(n):
    # outer loop will handle number of rows    
    # n in this case    
    for i in range(0, n):
        # inner loop will handle number 
          of columns for space printing        
       for k in range(0, n-i):
            # printing stars            
            print("  ", end="")
        # inner loop will handle number of columns 
        for star printing        
       for j in range(0, i + 1):
            # printing stars
            print("* ", end="")
            # ending line after each row
        print("\r")
    # Driver Code
n = 6python_pattern(n)





Output-


                 * 
              * * 
           * * * 
        * * * * 
     * * * * * 
  * * * * * * 


Saturday, August 24, 2019

Python Pattern Program Example With Code

As all of us knows that as we used to print the pattern program in C, JAVA,Net etc. To make comfortable and understand to the new user in Pyhton we started learning that programming language.

In the same way to make confidence, Comfortable and learn syntax and logic writing style in Python we can practice for this i am showing to all of you more than 20 pattern program code in Python.
You can copy and paste these code  and even test at your own system. Users can modify these Codes too accrding to requirement.

---------------------------------------------------------------------------------
Example 1-
Python pattern program example

...................................................................................................................................................................
Source Code- Pycharm IDE

# Function to demonstrate printing pattern
  def python_pattern(n):
    # outer loop to handle number of rows    
    # n in this case  
        for i in range(0, n):

        # inner loop to handle number of columns       
        # values changing acc. to outer loop       
             for j in range(0, i + 1):
             # printing stars           
               print("* ", end="")

            # ending line after each row      
         print("\r")

    # Driver Code
    # No of rows variable length
    n = 6
    python_pattern(n)


Output-

F:\web\venv\Scripts\python.exe F:/web/pattern.py
* * 
* * * 
* * * * 
* * * * * 
* * * * * * 

Process finished with exit code 0




Friday, August 23, 2019

SQL SERVER High Availability (HA)

High Availability (HA)  of the server of  Database is the solution( process, technology ) to make the application database available 24x7 under either planned or un - planned conditions.   


There are five type of options in MS SQL Server to achieve and configure a setup for high availability solution for the databases. 
SQL SERVER High Availability (HA)


Replication 
The source(Main) data will be copied to destination, through replication agents (jobs). Object level technology. 
Main terminology 

  1.  Publisher is source server. 
  2.  Distributor is optional and stores replicated data in a suitble environemt for the subscriber.  
  3.  Subscriber is the destination server. 

Log Shipping 
The source data will be copied to destination through Transaction Log backup jobs. Various Database level technology. 
Main terminology 

  1.  Primary server is source server. 
  2.  Secondary server is destination server.
  3.  Monitor server is optional and will be monitored by log   shipping status.  


Mirroring 
The primary data will be copied to a secondary through a network transaction basis with help of mirroring endpoint and port number. Database level technology. 
Main terminology 

  1.  Principal server is source server always. 
  2.  Mirror server is destination server always.
  3.  Witness server is optional and can be used to make automatic  failover. 


Clustering 
The data will be stored in shared location which is used by both primary and secondary servers based on availability of the server. Instance level technology. Windows Clustering setup is required with shared storage 
Main terminology 

  1.  Active node is where SQL Services are running.
  2.  Passive node is where SQL Services are not running. 

AlwaysON Availability Groups 
 The primary data will be copied to secondary through network transaction basisand  Group of database level technology. Windows Clustering setup is required without shared storage for ALwaysON Availibilty Groups. 
Main terminology 

  1.  Primary replica is source server.
  2.  Secondary replica is destination server. 
Check Java Pattern Program
Java traingle pattern program




Sql Server error 276

Translate