Python: Built-in Functions -hasattr(), getattr(), setattr(),delattr(), issubclass()

I have come across an excellent quick and easy to understand python video today. I would like to share to all my energetic and aspiration readers

Source: Sharp El youtube channel, Thanks for the team
Advertisements

GitHub Complete understanding for professional developer

What is remote and origin in git?

remote” is just some git repository not on your computer (e.g. on github). “origin” is the repository you cloned your repository from (e.g. the one on your github). “master” is just the name of the default branch.

What is downstream and upstream in git?

As far as Git is concerned, every other repository is just a remote. Generally speaking, upstream is where you cloned from (the origin). Downstream is any project that integrates your work with other works. The terms are not restricted to Git repositories

What is a GitHub fork?

 A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project. Most commonly, forks are used to either propose changes to someone else’s project or to use someone else’s project as a starting point for your own idea.

Syncing a fork

Sync a fork of a repository to keep it up-to-date with the upstream repository.

Before you can sync your fork with an upstream repository, you must configure a remote that points to the upstream repository in Git.

  1. Open Git Bash.
  2. Change the current working directory to your local project.
  3. Fetch the branches and their respective commits from the upstream repository. Commits to master will be stored in a local branch, upstream/master.
    git fetch upstream
    remote: Counting objects: 75, done.
    remote: Compressing objects: 100% (53/53), done.
    remote: Total 62 (delta 27), reused 44 (delta 9)
    Unpacking objects: 100% (62/62), done.
    From https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY
     * [new branch]      master     -> upstream/master
  4. Check out your fork’s local master branch.
    git checkout master
    Switched to branch 'master'
  5. Merge the changes from upstream/master into your local master branch. This brings your fork’s master branch into sync with the upstream repository, without losing your local changes.
    git merge upstream/master
    Updating a422352..5fdff0f
    Fast-forward
     README                    |    9 -------
     README.md                 |    7 ++++++
     2 files changed, 7 insertions(+), 9 deletions(-)
     delete mode 100644 README
     create mode 100644 README.md

    If your local branch didn’t have any unique commits, Git will instead perform a “fast-forward”:

    git merge upstream/master
    Updating 34e91da..16c56ad
    Fast-forward
     README.md                 |    5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)

Configuring a remote for a fork

You must configure a remote that points to the upstream repository in Git to sync changes you make in a fork with the original repository. This also allows you to sync changes made in the original repository with the fork.

  1. Open Git Bash.
  2. List the current configured remote repository for your fork.
    git remote -v
    origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
    origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
  3. Specify a new remote upstream repository that will be synced with the fork.
    git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
  4. Verify the new upstream repository you’ve specified for your fork.
    git remote -v
    origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
    origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
    upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
    upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)

Changing a remote’s URL

The git remote set-url command changes an existing remote repository URL.

The git remote set-url command takes two arguments:

  • An existing remote name. For example, origin or upstream are two common choices.
  • A new URL for the remote. For example:
    • If you’re updating to use HTTPS, your URL might look like:
      https://github.com/USERNAME/REPOSITORY.git
      
    • If you’re updating to use SSH, your URL might look like:
      git@github.com:USERNAME/REPOSITORY.git

Which remote URL should I use?

Refer the link:  https://help.github.com/articles/which-remote-url-should-i-use/

GITHUB PULL REQUEST, Branching, Merging & Team Workflow

 

What all should I Collect while resigning From TCS?

First of all, congrats and best wishes.

If you leaving your job completely (Not joining any company), you can withdraw your PF amount easily after 3 months of leaving TCS. For this, you require UAN number and pension account number (after you leave TCS, the amount of provident fund is transfer to pension fund).

If you are joining another job, then simply make a note of the UAN and pension account number and later you can get it transferred. HR of the new organization can help you.

Regarding bond amount- They don’t usually ask for the entire amount unless there is some dependency of project on you.

All you need to ask while leaving is a release letter which mentions date of release from TCS and you are good to go. No other formalities are mandatory.

What is the process to resign TCS? What are the buyout procedures? Any way to escape bond amount if only two months are left for bond period?

Step 1 – Talk to your team lead & manager.

Step 2 – Once they agree, drop a mail to HR keeping lead & Manager in CC regarding the resignation. The moment you click the send button, your notice period starts.

Step 3 – Speak to the HR. Query about the notice period shortfall amount & bond amount to be paid. Now notice period is 3 months. If you are willing to work in the notice period, you will cover your tenure of 2 years hence the service bond stands nullified. If you wish to decrease your notice period, there is a shortfall amount to be paid (=a month’s basic) which will be prorated on the number of days you wish to work less. But in this case you might have to pay the bond amount.

Bond amount is reduced only in cases of higher studies, where you need to submit admission letter and payment receipt to college as a proof. Else it is highly unlikely your bond amount will be reduced.

Step 4 – (Most Important) Ask your team lead/supervisor to initiate separation process in ultimatix. It goes through various levels of approvals hence takes time.

The decision of reducing bond amount lies with the Head HR, and will be taken according to your resignation (job switch/higher studies). The decision taken by him/her is final and non negotiable.

Step 5 – Download all payslips, certificates, letters and appreciations to keep a local copy with you as you lose your access to Ultimatix on LWD. Keep track of your PF account.

Step 6 – A week before LWD, make sure you receive the resignation acceptance mail. Most important mail which contains various docs.

Step 7 – clear your dues with the library, untag any resources before LWD.

Step 8 – Report at your head office of the region, submit ID, Drawer Key, demand draft etc. Collect interim release letter. Be a proud TCS Alumni.

wishing the best for your journey ahead!

Difference Between Provident Fund and Pension Fund

Provident fund is a fund created by the employer’s in which a certain percentage of the basic salary is contributed every month by the employer and the employee. On the other hand, the pension fund is a fund established by the employer in which a certain percentage of employee’s salary is contributed month on month by the employer.

At present, employees are regarded as assets of the company are they are responsible for its performance and position in the market. In fact, the success and failure of any company lie on the shoulders of its employees. For the purpose of retaining the efficient and hardworking employees for a long time, there are many allowances perquisites offered by the employer. One such scheme is to give them retirement and old age benefits so that they will not have to struggle at the later stage of life. Here we are talking about the provident fund and pension fund.

There are a number of differences between provident fund and pension fund which are described below in four category

  1. Comparison Chart
  2. Definition and it’s types
  3. Key Differences
  4. Conclusion

1. Comparison Chart

BASIS FOR COMPARISON PROVIDENT FUND PENSION FUND
Meaning A fund in which employer and employee makes a contribution while an employee is in employment with the organization is known as Provident Fund. A fund created by the employer in which he contributes an amount, for providing retirement benefits to the employee is known as Pension Fund.
Who is eligible to make a contribution? Both employer and employee Employer and Central Government
Statute Employee’s Provident Fund Scheme, 1952 Employee’s Pension Fund Scheme, 1995
Nature of amount received Lump sum Either in lump sum or in the form of regular income, depends on the pension opted by the member.
Basis of amount The contribution made by both the parties, plus interest thereon. The pension amount will the based on an average of last 12 month’s salary and years of service.
Withdrawal A person can withdraw the entire amount of provident fund. Only one third amount can be withdrawn.

2. Definition of Provident Fund (PF) and it’s types

Provident means to provide for future and fund refers to a sum of money kept aside for a particular purpose. Therefore, the term provident fund (PF) means keeping a certain sum of money aside to provide retirement benefits. In this scheme, a specified sum is subtracted from the employee’s salary and transferred towards the fund in the form of his contribution. The employer also participates in contributing money to the fund. The rate of contribution to PF is 12%.

The employee’s account is credited with the amount of interest received from investing the contribution of both the parties in approved securities. At the time of the employee’s retirement or resignation, the accumulated amount of the fund is paid to him. However, if the employee dies, the same is given to his legal representatives. The given are the types of Provident Fund:

  • Statutory Provident Fund (SPF): Statutory Provident Fund applies to the persons who are in employment with the government, university, etc., whether it is central, state or local self. The amount received is fully exempt from tax.
  • Recognized Provident Fund (RPF): This applies to the establishment which employs 20 or more persons. The Fund is recognized by the Commissioner of income tax. The amount received on maturity will be free from tax only if:
    • The employee served for more than five years.
    • The employee served for less than five years and the reason for termination is due to ill-health or employer’s business ceases to exist etc.
  • Unrecognized Provident Fund (URPF): Unrecognized Provident Fund is a fund started by the employer and employees of the organization, but not recognized by the Commissioner of Income Tax. Leaving employee’s contribution, the rest of the amount is taxable as income from salary.
  • Public Provident Fund (PPF): This is a provident fund scheme for the self-employed person, in which they can make a contribution of Rs 500 to Rs. 150000 per year. The amount received and contributed is fully exempt from tax.

Definition of Pension Fund

In simple terms, the word pension means regular payments made by the government or any other employers to their employees, for the services rendered by them in the past.Pension fund implies a fund in which the employer contributes an amount for providing the following benefits like superannuation (regular payment made into a fund by an employee towards a future pension) , retirement, disability and others.

The fund is financed by the transferring a part of employer’s contribution towards an employee’s provident fund to pension fund i.e. when the employer contributes 12% to provident fund, 3.67% is contributed to the provident fund and rest is diverted towards pension scheme. Central Government also contributes to the pension fund at a rate of 1.16% of the pay of the employee provided certain conditions are fulfilled.

On the retirement of the employee, he will get periodic payments of a specified sum such pension is known as uncommuted pension which. However, the employee can also opt for commuted pension whereby he can get the entire or part amount in a lump sum.

3. Key Differences Between Provident Fund and Pension Fund

The following are the major differences between provident fund and pension fund:

  1. Provident Fund is a kind of fund in which employer and employee make a contribution during the service of the employee to provide for future benefits. Pension Fund, on the other hand, is also a fund in which employer contributes a specified sum to provide retirement benefits to the employee as a consideration for his past services.
  2. In provident fund, both employer and employee contribute to the fund, but in the case of pension fund employer and central government contribute to the fund.
  3. Provident Fund works under the Employee Provident Fund Scheme, 1952 whereas Pension Fund works under Employees Pension Fund Scheme,  1995.
  4. The amount received by an employee in Provident Fund is in a lump sum. Conversely, it is up to the employee whether he wants to commute his pension or not in the case of the pension fund.
  5. In Provident fund, the amount received is an aggregate of the contribution made by both the parties and interest thereon. In contrast to the pension fund, the basis of pension is an average of 12 month’s last drawn salary and period of service

4. Conclusion

Provident Fund and Pension Fund are two schemes of government, in which an employee can get consideration for his services rendered by him for years. An employee can withdraw the whole or part of an amount in the provident fund when he is in need of it, like the construction of the house, illness, marriage or education, etc. However, the only one-third amount can be withdrawn in case of the pension fund.

How to Think about the Internet of Things (IoT)

People have tried to define the Internet of Things. But as a hardware or software engineer, you already know the essential element: to build interconnected products.

Embedded systems are already playing a crucial role in the development of the IoT. In broad strokes, there are four main components of an IoT system:

  • The Thing itself (the device)
  • The Local Network; this can include a gateway, which translates proprietary communication protocols to Internet Protocol
  • The Internet
  • Back-End Services; enterprise data systems, or PCs and mobile devices

The Internet of Things from an embedded systems point of view

IoT systems are not complicated, but designing and building them can be a complex task. And even though new hardware and software is being developed for IoT systems, we already have all the tools we need today to start making the IoT a reality.

We can also separate the Internet of Things in two broad categories:

  • Industrial IoT, where the local network is based on any one of many different technologies. The IoT device will typically be connected to an IP network to the global Internet.
  • Commercial IoT, where local communication is typically either Bluetooth or Ethernet (wired or wireless). The IoT device will typically communicate only with local devices.

So to better understand how to build IoT devices, you first need to figure out how they will communicate with the rest of the world.

PF vs PPF: What’s the difference?

1. What is PPF and PF?

EPF/ PF

The Employee Provident Fund, or provident fund as it is normally referred to, is a retirement benefit scheme that is available to salaried employees.

Under this scheme, a stipulated amount (currently 12%) is deducted from the employee’s salary and contributed towards the fund. This amount is decided by the government.

The employer also contributes an equal amount to the fund.

However, an employee can contribute more than the stipulated amount if the scheme allows for it. So, let’s say the employee decides 15% must be deducted towards the EPF. In this case, the employer is not obligated to pay any contribution over and above the amount as stipulated, which is 12%.

PPF

The Public Provident Fund has been established by the central government. You can voluntarily decide to open one. You need not be a salaried individual, you could be a consultant, a freelancer or even working on a contract basis. You can also open this account if you are not earning. 

Any individual can open a PPF account in any nationalised bank or its branches that handle PPF accounts. You can also open it at the head post office or certain select post offices.

The minimum amount to be deposited in this account is Rs 500 per year. The maximum amount you can deposit every year is Rs 70,000.

2. What is the return on this investment?

EPF: 8.5% per annum

PPF: 8% per annum

3. How long is the money blocked?

EPF

The amount accumulated in the PF is paid at the time of retirement or resignation. Or, it can be transferred from one company to the other if one changes jobs.

In case of the death of the employee, the accumulated balance is paid to the legal heir.

PPF

The accumulated sum is repayable after 15 years.

The entire balance can be withdrawn on maturity, that is, after 15 years of the close of the financial year in which you opened the account.

It can be extended for a period of five years after that. During these five years, you earn the rate of interest and can also make fresh deposits

4. What is the tax impact?

EPF

The amount you invest is eligible for deduction under the Rs 1,00,000 limit of Section 80C.

If you have worked continuously for a period of five years, the withdrawal of PF is not taxed.

If you have not worked for at least five years, but the PF has been transferred to the new employer, then too it is not taxed.

The tenure of employment with the new employer is included in computing the total of five years.

If you withdraw it before completion of five years, it is taxed.

But if your employment is terminated due to ill-health, the PF withdrawal is not taxed.

PPF

The amount you invest is eligible for deduction under the Rs 1,00,000 limit of Section 80C.

On maturity, you pay absolutely no tax.

5. What if you need the money?

EPF

If you urgently need the money, you can take a loan on your PF.

You can also make a premature withdrawal on the condition that you are withdrawing the money for your daughter’s wedding (not son or not even yours) or you are buying a home.

To find out the details, you will have to talk to your employer and then get in touch with the EPF office (your employer will help you out with this).

PPF

You can take a loan on the PPF from the third year of opening your account to the sixth year. So, if the account is opened during the financial year 1997-98, the first loan can be taken during financial year 1999-2000 (the financial year is from April 1 to March 31).

The loan amount will be up to a maximum of 25% of the balance in your account at the end of the first financial year. In this case, it will be March 31, 1998.

You can make withdrawals during any one year from the sixth year. You are allowed to withdraw  50% of the balance at the end of the fourth year, preceding the year in which the amount is withdrawn or the end of the preceding year whichever is lower. 

For example, if the account was opened in 1993-94 and the first withdrawal was made during 1999-2000, the amount you can withdraw is limited to 50% of the balance as on March 31, 1996, or March 31, 1999, whichever is lower.

If the account extended beyond 15 years, partial withdrawal — up to 60% of the balance you have at the end of the 15 year period — is allowed.

In both cases, contributions get a deduction under Section 80C and the interest earned is tax free. 

Having said that, PF scores over PPF in two aspects.

In the case of PF, the employer also contributes to the fund. There is no such contribution in case of PPF.

The rate of interest on PF is also marginally higher (currently 8.65%) than interest on PPF (9.8%).

Differences Between a Cheque, Demand Draft (DD) and Pay order

A cheque is a Bill of Exchange drawn on a specified banker and not expressed to be payable otherwise than on demand.

Demand Draft is a pre-paid Negotiable Instrument, wherein the drawee bank acts as guarantor to make payment in full when the instrument is presented. DD cannot be dishonored as the amount is paid before hand. Demand draft is usually used to make payment outside a city. Demand Draft can be cleared at any branch of the same bank. A demand draft of value Rs 20,000 or more can be issued only with A/c payee crossing.

The payment order is a financial instrument issued by the bank on behalf of customer stating an order to pay a specified amount to a specified person within the same city.

Note: Cheque and Demand drafts (DD) are both negotiable instruments. Both are mechanisms used to make payments.

Example to differntiate the Cheque and DD

Let us say that you want to make payment for the purchase of a flat. On the day of registration, if you hand over a cheque and the property is registered and the cheque bounces for some reason, you cannot reverse a property that is registered.

In a demand draft there is guaranteed payment by the banker and there is no question of it bouncing. The biggest difference between a cheque and a DD is that the payment is always honoured.

Pay Order or Banker’s Cheque

The payment order is a financial instrument issued by the bank on behalf of customer stating an order to pay a specified amount to a specified person within the same city.

In payment order is pre-printed with the word “Not Negotiable” . There is no chance of dishonoring as the amount is prepaid. Once issued Pay order will be valid for 3 months.

Instruments  Pay Order  Demand Draft
Purpose Pay order is an instrument used to make payment within the same city DD is used to transfer money by an individual from one city to another person in a different city.
Feature Pay order are pre-printed with “NOT NEGOTIABLE”. Demand Draft is a negotiable instrument
Clearance Pay order to be cleared in any branch of the same city. DD can be cleared at any branch of the same bank.

Financial transaction tip: In a business transaction, cheque is not usually accepted as the drawer and payee are unknown and there will be credit risk. So, in such cases Demand draft is accepted where the transfer of money is guaranteed.

Difference Between CD-R and CD-RW

A CD-R is a type of disc that does not contain any data. It is blank so that a user can write his own data into the disk for various purposes, like data storage and back-up. An improved version of that is the CD-RW, which is a disk that can be written on multiple times. The user can erase the content of the disk or write new data into it whenever he likes to, much like the older diskette technology.

The CD-R was made to be compatible with all devices that utilize the same medium, even though the method of writing data into the disc differs slightly compared to traditional CDs. The CD-R was also known as ‘Write Once Read Many’ because of the fact that you can only write to the disc once. This might be a little bit confusing since you can actually write on a CD-R a few times since it allows writing to the disc in increments. The CD-R medium also brought forth its own drive. The CD Writer is a drive that looks and acts like a normal CD-ROM but with the capability to write data into CD-Rs.

What you do on a CD-R is to erase the old data and replace it with a new one. Once the disc is full, you cannot add or replace data on it. That shortcoming has been remedied by the appearance of CD-RW discs. These discs are very similar to the CD-R but have the added feature of being erasable. Erasing the data in a CD-RW disc makes it revert to its old state and can be used just like a blank disc. The technology of CD-RW requires much better optic technologies than what CD-R requires, thus CD Writers cannot write into the CD-RW. Although backwards compatibility means that all CD writers and some of the older CD-ROMs could read a written CD-RW.

CD-Rs do have a few advantages over the CD-RW, one of which is the fact that that the former costs a lot less compared to the latter. CD-Rs are also a lot more reliable in storing data due to the unstable nature of the alloy used in CD-RWs. Read and write times are also significantly higher in CD-RWs causing longer wait for the user. With those arguments, the CD-R and CD-RW are just about even when weighed in. CD-Rs are appropriate for storing data for long periods of time like in back-ups while CD-RWs are excellent when transferring files from one PC to another due to it reusability.