Sunday, 1 May 2022

Subarray with given sum

Given: Unsorted array 

Find: Subarray starting index  to last index on summing up gives the given sum



arr[] = {1, 4, 20, 3, 10, 5}, sum = 33


C++ Solution

#include <iostream>
#include <cstdio>

using namespace std;

int subwithsum(int arr[],int n, int sum)
{
  
   int curr_sum, i, j;
   for (int i=0; i<n; i++)
   {
     curr_sum=arr[i];
     for (j=i+1; j<=n; j++)
     {
       if(curr_sum==sum)
       {
         cout<<i<<"and"<<j-1;
         return 1;
       }
      
       if(curr_sum>sum || j==n)
         break;
       curr_sum=curr_sum + arr[j];
      
     } 
    
   }
  
   cout<<"no sub array";
   return 0;
}


int main()
{
   int arr[]={3,8,2,1,9};
   int n=5,sum=10;
  
   subwithsum(arr,n,sum);
   return 0;
}



Tuesday, 23 June 2020

Is 5G Coronavirus conspiracy theory true or false?


Hi guys, I am 5G the fifth-generation technology promising high speed & connectivity but before coming to you I have to help my friend coronavirus. People say it's 5G coronavirus v/s humans war.




During Corona period this theory is all over the internet.
It all started by the pseudoscientist & a conspiracy theorist, Barrie Tower who says that 5G is spreading the coronavirus at a faster rate and also affecting our immune system making our body weaker to prone to diseases.
Social media in a marketing way made this a breaking news.



Claims about 5G coronavirus news
• It affects the immune system.
• Droplets can travel on 5G waves.


Proofs that 5G coronavirus theory is purely false

Yeah, these claims are false !!

Not affecting the immune system:

• 5G is a radio wave & these waves are of lower frequency like WiFi and are non- ionising that means it can not penetrate our body, unlike X-rays & UV whose exposure will damage our cells.


•Strong waves i.e. high energy waves can do heating  but radio waves are not strong enough to warm up the body.


Not Spreading coronavirus:

•Coronavirus is still spreading at a huge rate in countries having no 5G network like Iran.


•Virus  droplets can't travel on radio waves. It can only be spread by inhaling the droplets or by touching the infected places.


This 5G coronavirus theory created huge havoc in UK and other places, where People are destroying cell phone towers, harassing and attacking the telecom engineers.
They made their campaign  "Stop 5G Stop Corona"

Social media find and delete fake 

Social media platforms like Facebook, Twitter, YouTube etc.are removing contents giving false information on coronavirus pandemic.




Doctors and scientists are there to think if u can't think then stop spreading false news , leading to disruption of our only to communicate.

For any information about coronavirus visit WHO.






 
 









Creating Passwords that will take years to crack

  

Are you watching stranger things on Netflix or any other shows.?                      My password is 'netflix123' [ size: 10 and medium strength based on password strength test . It's boring creating passwords with strong strength.

...

After 2 mins.


Well, this article will clear all your doubts about the importance of creating a password with strong strength.


Database breach is common these days not leaving tech giants like Facebook etc.
Recently unacademy, a leading education portal got hacked,22 millions of customers data got leaked.

Their passwords are now changed because those were very weak according to password strength test.

You'll be thinking the sites are not encrypting your data, then you're wrong.

Remember:

"No encryption can save a weak password from getting cracked."

UK's National Cyber Security Centre (NCSC) conducted a survey then analyzed the passwords of accounts that are stolen worldwide.

List of  top 10 common passwords is your password among them

123456.

123456789.

qwerty.

password.

111111.

12345678.

abc123.

1234567.


Any hacker should be able to crack the above passwords in the blink of an eye.

Have you created a strong password?



Don't assume your passwords are being guessed as hackers use computer tools to  crack passwords using the below methods:

  •   Brute force: It's a hit & trial method where words formed using the combination of a set of characters are checked. But it takes a lot of time to crack longer passwords.


'roses are red' is this is your password
with meaningful words, then it's safe!!           

But.....!?

  •   Dictionary attack: It's best for long password or passphrases. As users having long password always uses some meaninful words, a combination of meaningful phrases or maybe mnemonics.


And the dictionary is a book off meaningful words or phrases, or most used passwords.


 They got your password
'roses' 'are' 'red' each word is available in our English dictionary.

Creating passwords with strong strength

Not to use your family name, your name, your phone no. etc.

Rules:
•Upper Case letters (A-Z)  
•Lower Case letters (a-z) 
•Digit (0-9)   
•Special characters (@,# etc.)  >
•long password (min. 10 characters)


Length is important?

asdfgh nearly takes 0 seconds to crack.


asdfghjkl adding 1 more character increases its cracking time to 0.01 sec.

Let's try to create a complex password,
I've created an 8 length password

(T-i0!H;         [ 9 years to crack it ]

(T-i0!H;h      [886 years to crack it ]

Wow.....
I think the hacker is dead!!

But It's difficult to remember this strong password right?
If we can't remember then all our time is being spent on resetting our passwords.

Let's try to make some pattern!

Taking a simple sentence

"My name is Charles."

>> My/ name/ is/ Charles.

M/n/I/C. [ 203 years] 

>>created a memorable strong password

It's too easy to remember but difficult to crack.

Now your turn, create a million-year password for your account and do strength test using the below my1login tool.



Note: This tool will not save the password you're typing and gives approx. results, as the processors & tactics are getting advanced day by day.

Thursday, 11 June 2020

The Recaptcha of Google will soon lose the market of captchas



The battle of captchas starts from 2020




 Google Recaptcha v/s Hcaptcha let's see who is going to win?

I'm sure you're thinking that I'm stupid as of course, Google's Recaptcha will win!.

Does that mean Hcaptcha will not stand a chance?

Let's learn who's more  probable to make a win but before this learn about the captcha, from below:




Captcha is a system created to prevent spam done using bots i.e person verifying the person on the site is human or a robot.


History started using captcha


It was first used in 1997 but didn't have a name of captcha. 

So real captcha we see today started it's a real journey from Carnegie Mellon University in 2000, then a lot of companies like PayPal started using it to prevent the fraudulent activities.


These types of fraudulent, data scrapping activities raised since we started using the internet. So Google acquired this awesome technology in 2009 named it as Recaptcha we see today.

 It began using it for their Google books. Google is a big tech company at that time, distributedRecaptcha under its supervision to companies etc. for free.




Recaptcha is getting weird


Google is still a brand  and its Recaptcha is on every site even at big sites like Facebook, Twitter etc. 

But this name created a new ability to spy on user .

As most of the sites reported that it is not paying attention to its privacy policy and is collecting users data from their websites for its benefits. 


*Stealing unnecessary data*


Even Google converted its free service of Recaptcha to paid.



To take over the market of Recaptcha,

hCaptcha a best alternative is born with a:


 •Trusted  privacy policy 

•A free service 

•you'll get paid 


Due to these things even the  major website security provider company (DDos protection, internet security etc.) Cloudflare in April 2020 adopted the hCaptcha to prevent the sites from getting hacked and dropped the captcha.



--------START USING  hCaptcha---------




Comment your queries below!








Wednesday, 10 June 2020

4 types of deployment models of cloud

I'm sure  you have learnt what's cloud  but which  deployment model of cloud is best for your business.
What if your making e-commerce platform or mailing service then which cloud model is best for your work?

There are 4 types of deployment models of cloud:

•Public Cloud
•Private Cloud
•Community Cloud
•Hybrid Cloud

Public Cloud:
Public cloud is publicly accessible to all people , organisation via internet. Cloud Resources are shared with more than thousand of people.

Advantages:

•Cost effective as you don't to manage the cloud ,the Service provider will handle it.

•Reliability that means any faliure will not affect your data.

•Location independent that means you must have an internet to access public cloud. 

•Unlimited Scalability i.e more server can be added to meet the high demand of traffic.

Disadvantages:

Lack of security as everyone's data is on the cloud 

•Lack of flexibility as  everything depends on service provider so you can't change your memory type,OS etc. the only thing edit & upload is your data.


When to Use?

If you're making an app or mailing service like Gmail,yahoo mail etc.where data should be publicly accessible to all people via internet.



Private Cloud :
Private cloud is for only one organisation and data is made privately accessible to the authorized  people  via internet or LAN.


Advantages :

•Highly Secured as data is not accessible to third party other than companies employee

•Increased performance as resources are not shared with anyone so much better speed etc.



Disadvantages:

•Costly, as  company has to work on every part like maintenance, deployment etc.

• Requires a good team of IT guys.


When to use?
Owning a company or setting up business there are some confidential information  that should not be shared with anyone.
Example : NASA


Community Cloud:
Community  cloud is the new type of cloud.
Cloud is made publicly accessible to those organisations having similar needs.

It is like coconut soft (public)from inside and hard(private) from outside.



Advantages :

•Controlled level of security as data is only accessible to organisation with same needs or interests.

•Less costly as cloud resources (speed,memory etc.) are shared with organisation 


Disadvantages:

•Not  a perfect choice for every organisation.

•more costly than public cloud.

•Slow adoption of data



When to use?

If you're organisation is working to share information with similar organisations.
Mainly used by government,healthcare  etc.

Eg : Criminals data of Police shared with FBI


Hybrid Cloud:


Hybrid cloud combines both public cloud & private cloud connecting each other.Both clouds works independently and data shared is highly encrypted.


Advantages:

•Cost effective as organisation has to pay for private cloud not for public cloud if not in use.

• A perfect place where both public and private cloud can interact

•Helps in growing business as costumers needs or  interests  can be analyzed.


Disadvantages:

•Complex security security is needed.

•Good team of IT guys otherwise private data can be easily visible to users.

When to Use?

Having an e-commerce platform where data needs to be processed based upon customer needs and providing the perfect product to buy .

Eg: Amazon

Now you have learnt the deployment models of cloud now try to check which model is perfect for your company to use.

Tuesday, 9 June 2020

Iaas, SAAS, Paas: Types of Cloud Computing Services - Part 2

Cloud computing didn't lose any users whether they are developers, simply customers, managers and created three types of cloud computing services SaaS, PaaS and IaaS.


SaaS  ( Software as a Service)

--For Customers

The product is maintained by the service provider.

You just have to use the software based on your subscription plans.    

SaaS



  Why SaaS?

• Users don't have to understand the algorithm behind it use the software and solve your problems.

• Users don't have to buy expensive software, just pay for it if there is some subscription and stop paying if u don't want to use.

• The source code is not available to users so no stealing of data. 

                   Just consume!!!

SaaS examples

SaaS examples


•Video watching platforms ( Netflix, Amazon Prime, Hotstar, YouTube)
•Messaging platforms ( Twitter, WhatsApp)
• Google Drive, Dropbox etc.

              

PaaS ( Platform as a Service)

--- For Developers

You have to focus & management of apps created.

Don't worry about the configuring hardware or OS.

PaaS



Why PaaS?
• It prevents you from buying hardware or software for deploying your apps

• Companies spends more time on software development rather than management and maintenance.

•Deploying apps require a high degree of skill but PaaS reduces in simple steps.

                    Just Build !!!

PaaS examples

PaaS examples


Google App engine,Heroku,Force.com etc.

IaaS (Infrastructure as a Service)

-- For Admins

The basic building block of cloud IT provides access to networking, OS, data storage. 

 Don't worry about the IT guys, servers and hardware.

IaaS



Why IaaS?

•Better for guys hosting their big website/web apps

•You don't have to buy land and get servers, easy setups are available; just buy it, everything will be handled by IaaS providers

•Increased reliability means if one server fails the other server will take over the data.

•No worry about securing your own data centres,  the provider will do that for you.

                        Just Host !!!

IaaS examples

IaaS examples


Cloud services used for hosting websites etc. Eg:Amazon Web services,Oracle ...many more

Try to guess major apps or sites as SaaS , IaaS or PaaS and comment below.

Next part : 

4 types of deployment models of cloud

Source:

https://www.google.com/amp/s/themindstudios.com/blog/saas-application-development/amp/

https://rgtechnologies.com.au/resources/platform-as-a-service/




Monday, 8 June 2020

Cloud computing is the new generation technology part 1

When ever someone had asked or giving an information about the term cloud computing is___.


You may be like day dreaming about yourself  flying on cloud ? and don't understand a thing.

What the hell is cloud & cloud computing?
Let's get the into deep


Cloud computing: Cloud(A virtual warehouse) where you can store data,services , hosting services like websites  etc.  But  you don't have to own a computer,Data stroing devices & processors ,large power supply nothing .

Data is stored forever until some mishaps or you delete it.


Entering into cloud computing is necessary: Evolution

It all started from  90s removing desktop computers as server we introduced the real thing called servers.


Dedicated server :

The complete server , resources and access is all dedicated to you  focusing only on one website.

•Very expensive
•High speed
•Managing things like security,back up etc. on server is done by you.

Uses: 

A website seeing high level of traffic ,web applications etc. 
(One application or one website)
For eg: Facebook



Virtual Private Server (VPS):

The complete server is all yours but resources (Ram,CPU etc.) are shared to host  many websites and web applications

•expensive 
•shared speed and memory


Used:

When you want to host many websites and web apps .



Shared hosting
One server is dedicated to a lot of users hosting many websites ,web apps etc.
Resources (ram, CPU etc.)are shared between users.

•very cheap
•very limited

Used:
When you are just starting to host something

Like starting a small website


Shared hosting was good but what if server goes down or destroyed etc.

This means we need lot of servers 
Then the idea of cloud computing began

Cloud hosting :
Multiple servers acting as a single machine hosting many websites /apps and used by many users 


Top 5 benefits shows that  Cloud computing is the best 


•flexible
•scalable
•secure
•cost effective (pay as you go)
•high configurability



•Use when your website/web apps is receiving a fluctuating  high  to low traffic  

•Your website /app is related to  online services like social media platforms eg: Twitter, Instagram etc.
Video watching platforms like Netflix etc.

Cloud computing is used by many well known companies

Netflix

Xerox

Pinterest

Instagram

Etsy

Apple

MediaMath


Cloud computing is even used by you everyday!!

Google drive,gmails, Watching online shows ,paying online , shopping etc.
Soon it will rule the world of data storing & processing.

Next part : 

Sunday, 5 April 2020

11 tests performed on mobile apps before deployment: app testing





Do apps get certified before getting published on various app downloading platforms like Google playstore ??


Apps




Today  everyone  is using mobile phones for their various works so more & more applications are created for different uses .

But is it safe  for your device ?


Before looking for answers & getting into thoughts let me tell u  the creaters of mobile applications always test their applications functionality, usability & consistency .
"This procedure is known as mobile application testing."

•usability: how users feels while using   
the application i.e simple & interactive

•functionality: how it is performing in background i.e ram ,battery using etc.

•consistency:data getting transferred & saved properly from both client & server side



There are 2 types of testing :


Automated testing: Emulators & simulators to create a virtual environment to test various devices .

Automated testing


Manual testing: Different users tests the app on different devices ,includes beta testing of apps .





Perquisite knowledge before testing


There are 3 kinds:

Native apps: subjected use in particular devices  like Samsung calculator for Samsung

Mobile web apps: apps which are use used to search websites like Chrome,Firefox


Hybrid apps: combination of both native & mobile web apps like Facebook





Different types of test performed on apps


Document testing :

Prepatory testing where Testers get navigational charts, screen layouts, other requirements invisible on the design. These requirements are analyzed for completeness and inconsistency.
Document testing


Functional testing :

Here system is tested against requirements .We also examine the output based on various inputs.
This testing checks User Interface, APIs, Database, Security, Client/Server communication and other functionality

Functional testing

Interruption testing:

 Checking about interruption caused due to:
• Incoming & outgoing SMS,MMS & calls.
•Battery discharge/removal.
•network disconnecting/connecting
•charging the device.


Business testing :


A person is able to add his/her item in cart .
Correct is displayed on the product i.e no delays in prices while on festival or like big billions days .
Transactions / withdrawals are safely made .


Constant user feedback testing:

Clicking of the buttons on the app giving perfect response as soons as the icon,button etc. Is clicked/pressed i.e no delays.
Eg : Volume up / down while playing media.

Update testing :

User's data is displayed properly while opening & stored properly while closing the app.

Device resource testing:
Lack of memory to install the application:



Usability testing:

It is aimed to check convenience of an app must 3 criterias:
------>Satisfaction

------->Efficiency

-------->Effectiveness

App is performing well in both portrait & landscape mode.
Zoom in & out is proper functioning .
Buttons etc. are not overlapping with each other.


Compatibility testing:


Unlike web applications, mobile app testing is more challenging because:


Different ranges of mobiles : with keypad ,touch screen etc.

Wide variety of mobile devices: Samsung ,Apple
etc.

Different os : like windows,iOS & android

Different versions of systems:  like android 6, android 9 etc.

Different mobile network range : like 3G,4G etc.


Performance testing:

Its main aims are:

•Load testing: checking the response      time of inputs performed by users.

•Stress testing: increasing / decreasing the loads on a device affects the performance of an app.

•Stability  testing: performance of an app on longer durations.

•concurrency testing:  increasing/decreasing the no. of users at a time affects the performance.


Security testing:

Logins, passwords & various sensitive informations are safely secured or not from various malicious attacks on apps
Or SQL injection & DOS attacks on server side.
Security test



Recovery testing:

It verifies the app under test in terms of its ability to withstand and successfully recover from possible failures caused by software errors, hardware failures, or communication problems.


After going through these testing phases it gets certified mark by various app downloading platforms like playstore etc





Sunday, 29 March 2020

You have entered a wrong credit card number : dcode.luhn



   

You have entered a wrong credit card number : dcode.luhn                    




 We  are  surrounded by numbers from everywhere , like our pin , password etc;
These numbers really amazed me when I was buying something from Flipkart &accidentally entered a digit wrong of my card number in payment page .It displayed the message as shown below:








After surfing the internet I  learnt about an interesting algorithm behind our card numbers called Luhn's Algorithm.The Luhn algorithm or Luhn formula, also known as the "modulus 10" or "mod 10" algorithm, named after its creator, IBM scientist hans Peter luhn., so we're gonna dcode.luhn.

Logic behind numbers

    
Step 1:
Multiply the digits at odd position by 2.






Step 2: 
If the digits multiplied by 2 becomes two digit no or no. greater than 10 then add them . For eg: 
5×2= 10 >>>1+0 = 1. 
7×2= 14 >>>1+4 = 5. 
9×2= 18 >>> 1+8 = 7.



Step 3:
Now add the new odd places digits & even places digits.
1+4+2+2+5+5+6+4+1+6+5+8+9+0+2+0 = 60


Step 4:
Check S the sum obtained in step 3 is divisible by 10 or not ,if it is then the card is valid otherwise not .


so 60/10 Remainder = 0 [true].


Therefore, the above example we use is a valid card number.

Click this link for validating

a different card numbers inputs


Note: dcode.luhn was designed to protect against accidental errors, not malicious attacks



Pseudocode [dcode.luhn]



function checkLuhn(string purportedCC) {
    int sum := integer(purportedCC[length(purportedCC)-1])
    int nDigits := length(purportedCC)
    int parity := nDigits modulus 2
    for i from 0 to nDigits - 2 {
        int digit := integer(purportedCC[i])
        if i modulus 2 = parity
            digit := digit × 2
        if digit > 9
            digit := digit - 9 
        sum := sum + digit
    }
    return (sum modulus 10) = 0
}

Applications


  • IMEI numbers
  • National Provider Identification number
  • Survey codes appearing on MC Donalds' ,Taco Bell etc.
  • Social Security Numbers .....so on



Strength

•It can detect any single error.


Weakness:

• Even a 16 digit 0 code will be  a valid card number.
Transposition of two digits 09 to 90 [vice-versa] is not detectable.
• It can't detect in twin digits 22 <-->55 
  For eg:
      22......... till 16 digits

           2+(4)=6.       [ 2×2=4]     
     
     55..... till 16 digits
        5×(1+0)= 6      [5×2=10]

One more thing I didn't mentioned other things  in are also considered validation

"Comment your queries ,love below &; don't forget to share it"



Tuesday, 11 February 2020

Why to learn C++ ?





C++ is created by Bjarne Strousoup is one of the  widely used language nowadays .
It is the successor of c language which is a procedural programming language (where we  do a problem step wise) .

Why C++?

•We brought a new concept in our programming language to solve any real life problem easily called OOPS [Object Oriented Programming Language] .
This concept brought power to our  languages .

•It is a generic programming language which means i.e algorithm written for one data type will not be different for different data types.

•It got  rich libraries ,from which we can make new codes.

•It is very fast.

•It's best to use while making system softwares.

APPLICATIONS

•Firefox & chrome have codes written in this language.

•Being closer to hardware mainly used to create system softwares.

•Used as an embedded language in machines.

•Various games like Doom,Counter Strike.

•Database softwares like MySQL
More...
It is written in c++


Job & Salary


Salary information from  gooroo.io
                                

               
•Junior Programmer

•Senior Programmer

•Software Developer

•Quality Analyst

•Game Programmer

•Software Developer Engineer

•C/C++ Analyst

Wednesday, 5 February 2020

Real meaning of programming language


 Programming language


A computer don't understand  human language as it is a machine.
So in order to interact with a machine
we need to learn a language called machine language or binary language[0 or 1]
In simple words On / Off.
But it is difficult for us to understand or write it.

So in order to communicate with computer we developed a language called programming language / high level language.

This is how a programming language looks like


Computer programs are written in various
programming language which is then converted to machine language using
translators like assembler,compiler & interpreter.
Pic credit: geeks for geeks


Have you ever wondered how double clicking an icon on the windows opens the application well it's because all OS are made up of programming languages so there is a statement in program which tells the computer to open the application if someone presses double click on it.
Android is a program


Every application or machine you use it's made from programming language.

From oldest programming language
[ COBOL & Fortran] to the advanced programming language we use today like
C++,java,python ,PHP etc. which can easily solve any real life problem.We are still working on more..
and each programming language has its own syntax .So one must learn it before writing a program.
Top 10 programming languages

But if you're thinking that whenever a new Programming language comes  it has to replace the old one , then you're wrong
Because every language has its own beauty.









Subarray with given sum

Given: Unsorted array  Find: Subarray starting index  to last index on summing up gives the given sum arr[] = {1, 4, 20, 3, 10, 5}, sum = 33...