Skip to main content

Posts

How to check CPU usage in Linux OS?

Generally top is a command to check CPU usage on any OS. top command htop Command In Linux Terminal command to CPU usage htop is another to do the task but before install htop as:  Sudo apt-get install htop  in terminal then after use htop command other than iostat,  /proc/meminfo,mpstat are the commands to be used to check CPU  and memory usages

Compress Data using ASCII Values and Decompress data to get back original ASCII

public class StrAscii {          public static void main(String[] args)     {               StrAscii.stringToBytesASCII("Apple");     }          public static byte[] stringToBytesASCII(String str) {  byte[] b = new byte[str.length()];  for (int i = 0; i < b.length; i++) {      System.out.println("Before Ascii "+i+" ="+b[i]);   b[i] = (byte) str.charAt(i);   System.out.println("After Ascii "+i+" ="+b[i]);   StrAscii sa=new StrAscii();      System.out.println("Compressed data Bytes "+i+" ="+sa.compressbyte(b[i]));   System.out.println("Compressed data Slots "+i+" ="+sa.compressslot(b[i]));   System.out.println("Decompressed data "+i+" ="+ (sa.compressbyte(b[i])*9+sa.compressslot(b[i])));  }  return b; }  public long compressslot(long x)  {      x = x%9; ...

Four Sequential or series Squared Numbers Formula's in two cases

In this I've observed and innovated new shortcut Math formula of Four Sequential or series Squared Numbers Formula's in two cases; Case 1: Only applicable for positive numbers; Case 2: it will be applicable both negative and positive numbers in those series; Condition : d- difference must be unique; See below pictures that I've made it in two formulas

Login and Registration forms in C# windows application with Back end Microsoft SQL Server for data access

In this article, I'm gonna share about how to make login and register form with MS SQL database; 1. Flow Chart Logic 2. Normal Features 3. Form Designs Login Form Design Sign in Form Design Password Retrieve Form 4. Database Design and SQL queries and Stored Procedure Create new Database as "schooldata" create table registerdata (  ID int identity,  Username nvarchar(100),  Password nvarchar(100),  Fullname  nvarchar(100),  MobileNO nvarchar(100),  EmailID nvarchar(100)  ) select * from registerdata create procedure regis (  @Username as nvarchar(100),  @Password as nvarchar(100),  @Fullname as nvarchar(100),  @MobileNO as nvarchar(100),  @EmailID as nvarchar(100)  ) as begin insert into registerdata (Username, Password, Fullname, MobileNO,EmailID) values (@Username, @Password, @Fullname, @MobileNO, @EmailID) ...

Print and PrintPreview in C# Windows Application

In this article; we gonna see how to make print and preview options in C# windows application 1. Design View of the windows Form 2. Code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace PrintOptions { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //printdocument associated with richTextbox value private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawString(richTextBox1.Text, richTextBox1.Font, Brushes.Black, 100, 20); e.Graphics.PageUnit = GraphicsUnit.Inch; } // print button private void button1_Click(object sender, EventArgs e) { printDialog1.Document = printDocu...

Data Display Form Using DataGridview tool in C# Windows Application

1. Design Form  Steps: a. Choose Datagridview tool in tool kit b. Choose new datasource from datagridview c. After choosing particular database and data table the design of form will be look a like in this above acreenshot 2. Class view for data table  3. Code created automatically using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using System.Data.Sql; namespace DataDisplayForm { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'nameDBDataSet.namedata' table. You can move, or remove it, as needed. this.namedataTableAdapter.Fill(this.nameDBDataSet.name...

C# Windows Application Data Form sample Module: Save and Retrieve Data using MS SQL database

Methods Used: 1. Created a database as NameDB and Database table as namedata as follows. --table for saving retrieving datas create table namedata (  ID int identity,  Firstname nvarchar(500),  Secondname nvarchar(500),  Fullname nvarchar(500) ) --get  query result select * from namedata 2. Create a  stored procedure for saving data -- creating stored procedure for saving data create proc nameprocedure  @Firstname as nvarchar(500), @Secondname as nvarchar(500), @Fullname as nvarchar(500) as begin   SET NOCOUNT ON; Insert into  namedata(Firstname,Secondname,Fullname) values(@Firstname,@Secondname,@Fullname) end -- execute strored procedure exec nameprocedure 3. Windows Application design for save and Retrieve data form set formborderstyle as none 4. App.config settings to Connect database <?xml version="1.0"?> <configura...