Tuesday, 30 January 2018

A Brief Introduction to Python and Its Features



Python Introduction:
Python is a broadly useful, dynamic, abnormal state and translated programming dialect. It underpins Object Oriented programming way to deal with create applications. It is straightforward and simple to learn and gives heaps of abnormal state information structures.

Python is anything but difficult to learn yet capable and flexible scripting dialect which makes it alluring for Application Development. Its linguistic structure and dynamic writing with its deciphered nature, makes it a perfect dialect for scripting and fast application advancement.
Python bolsters different programming design, including object situated, basic and useful or procedural programming styles. It isn't expected to take a shot at uncommon region, for example, web programming. That is the reason it is known as multipurpose in light of the fact that it can be utilized with web, undertaking, 3D CAD and so forth.

We don't have to utilize information composes to pronounce variable since it is powerfully written so we can compose a=10 to dole out a whole number an incentive in a whole number variable. It makes the advancement and investigating quick in light of the fact Python Training in Bangalore that there is no accumulation step incorporated into python improvement and alter test-troubleshoot cycle is quick.

Python History
•Python established its framework in the late 1980s.

•The usage of Python was begun in the December 1989 by Guido Van Rossum at CWI in Netherland.

•In February 1991, van Rossum distributed the code (named variant 0.9.0) to alt.sources.

•In 1994, Python 1.0 was discharged with new highlights like: lambda, guide, channel, and diminish.

•Python 2.0 included new highlights like: list perceptions, refuse gathering framework.

•On December 3, 2008, Python 3.0 (likewise called "Py3K") was discharged. It was intended to redress key blemish of the dialect.

•ABC programming dialect is said to be the ancestor of Python dialect which was fit for Exception Handling and interfacing with Amoeba Operating System.

•Python is affected by following programming dialects:
ABC dialect.
Modula-3

Python Features:
Python provides lots of features that are listed below.
1) Easy to Learn and Use
Python is anything but difficult to learn and utilize. It is engineer amicable and abnormal state programming dialect.

2) Expressive Language
Python dialect is more expressive implies that it is more reasonable and lucid.

3) Interpreted Language
Python is a deciphered dialect i.e. mediator executes the code line by line at once. This makes troubleshooting simple and in this way reasonable for novices.

4) Cross-stage Language
Python can run similarly on various stages, for example, Windows, Linux, Unix and Macintosh and so forth. Along these lines, we can state that Python is a compact dialect.

5) Free and Open Source
Python dialect is uninhibitedly accessible at official web address. The source-code is likewise accessible. Python Training in Bangalore Subsequently it is open source.

6) Object-Oriented Language
Python bolsters protest arranged dialect and ideas of classes and questions appear.

7) Extensible
It infers that different dialects, for example, C/C++ can be utilized to order the code and consequently it can be utilized further in our python code.

8) Large Standard Library
Python has an extensive and wide library and gives rich arrangement of module and capacities for fast application improvement.

9) GUI Programming Support
Graphical UIs can be produced utilizing Python.

10) Integrated
It can be effortlessly coordinated with dialects like C, C++ and JAVA and so on.

Author:
Infocampus is the Best place for Python Training in Bangalore, with certified experts Highly Talented with 8+ Years Experienced Trainers Well Equipped Class Rooms.
Infocampus provide real-time live projects and hands on experience; Training is also aligned with certifications so you can easily validate your newly acquired skills.
Infocampus is one of top and Best Python Training Institute in Bangalore.
Contact: 9738001024

Monday, 29 January 2018

10 Subtle Best Practices when Coding Java



This is a list of 10 best practices that are more subtle than your average Josh Bloch Effective Java rule. While Josh Bloch’s list is very easy to learn and concerns everyday situations, this list here contains less common situations involving API / SPI design that may have a big effect nontheless.

1. Remember C++ destructors

Remember C++ destructors? No? Then you might be lucky as you never had to debug through any code leaving memory leaks due to allocated memory not having been freed after an object was removed. Thanks Sun/Oracle for implementing garbage collection!
But nonetheless, destructors have an interesting trait to them. It often makes sense to free memory in the inverse order of allocation. Keep this in mind in Java as well, when you’re operating with destructor-like semantics:
  • When using @Before and @After JUnit annotations
  • When allocating, freeing JDBC resources
  • When calling super methods

2. Don’t trust your early SPI evolution judgement

Providing an SPI to your consumers is an easy way to allow them to inject custom behaviour into your library / code. Beware, though, that your SPI evolution judgement may trick you into thinking that you’re (not) going to need that additional parameter. True, no functionality should be added early. But once you’ve published your SPI and once you’ve decided following semantic versioning, you’ll really regret having added a silly, one-argument method to your SPI when you realise that you might need another argument in some cases:

3. Avoid returning anonymous, local, or inner classes

Swing programmers probably have a couple of keyboard shortcuts to generate the code for their hundreds of anonymous classes. In many cases, creating them is nice as you can locally adhere to an interface, without going through the “hassle” of thinking about a full SPI subtype lifecycle.
But you should not use anonymous, local, or inner classes too often for a simple reason: They keep a reference to the outer instance. And they will drag that outer instance to wherevery they go, e.g. to some scope outside of your local class if you’re not careful. This can be a major source for memory leaks, as your whole object graph will suddenly entangle in subtle ways.

4. Start writing SAMs now!

Java 8 is knocking on the door. And with Java 8 come lambdas, whether you like them or not. Your API consumers may like them, though, and you better make sure that they can make use of them as often as possible. Hence, unless your API accepts simple “scalar” types such as int, long, String, Date, let your API accept SAMs as often as possible.
What’s a SAM? A SAM is a Single Abstract Method [Type]. Also known as a functional interface, soon to be annotated with the @FunctionalInterface annotation. This goes well with rule number 2, where EventListener is in fact a SAM. The best SAMs are those with single arguments, as they will further simplify writing of a lambda.

5. Avoid returning null from API methods

I’ve blogged about Java’s NULLs once or twice. I’ve also blogged about Java 8’s introduction of Optional. These are interesting topics both from an academic and from a practical point of view.
While NULLs and NullPointerExceptions will probably stay a major pain in Java for a while, you can still design your API in a way that users will not run into any issues. Try to avoid returning null from API methods whenever possible. Your API consumers should be able to chain methods whenever applicable:

6. Never return null arrays or lists from API methods

While there are some cases when returning nulls from methods is OK, there is absolutely no use case of returning null arrays or null collections! Let’s consider the hideous java.io.File.list() method.
Was that null check really necessary? Most I/O operations produce IOExceptions, but this one returns null. Null cannot hold any error message indicating why the I/O error occurred. So this is wrong in three ways:
  • Null does not help in finding the error
  • Null does not allow to distinguish I/O errors from the File instance not being a directory
  • Everyone will keep forgetting about null, here

7. Avoid state, be functional

What’s nice about HTTP is the fact that it is stateless. All relevant state is transferred in each request and in each response. This is essential to the naming of REST: Representational State Transfer. This is awesome when done in Java as well. Think of it in terms of rule number 2 when methods receive stateful parameter objects. Things can be so much simpler if state is transferred in such objects, rather than manipulated from the outside.

8. Short-circuit equals()

This is a low-hanging fruit. In large object graphs, you can gain significantly in terms of performance, if all your objects’ equals() methods dirt-cheaply compare for identity first:

9. Try to make methods final by default

Some will disagree on this, as making things final by default is quite the opposite of what Java developers are used to. But if you’re in full control of all source code, there’s absolutely nothing wrong with making methods final by default, because:
  • If you do need to override a method (do you really?), you can still remove the final keyword
  • You will never accidentally override any method anymore

10. Avoid the method(T…) signature

There’s nothing wrong with the occasional “accept-all” varargs method that accepts an Object... argument:
1
void acceptAll(Object... all);
Writing such a method brings a little JavaScript feeling to the Java ecosystem. Of course, you probably want to restrict the actual type to something more confined in a real-world situation, e.g. String.... And because you don’t want to confine too much, you might think it is a good idea to replace Object by a generic T:

10 Subtle Best Practices when Coding Java



This is a list of 10 best practices that are more subtle than your average Josh Bloch Effective Java rule. While Josh Bloch’s list is very easy to learn and concerns everyday situations, this list here contains less common situations involving API / SPI design that may have a big effect nontheless.

1. Remember C++ destructors

Remember C++ destructors? No? Then you might be lucky as you never had to debug through any code leaving memory leaks due to allocated memory not having been freed after an object was removed. Thanks Sun/Oracle for implementing garbage collection!
But nonetheless, destructors have an interesting trait to them. It often makes sense to free memory in the inverse order of allocation. Keep this in mind in Java as well, when you’re operating with destructor-like semantics:
  • When using @Before and @After JUnit annotations
  • When allocating, freeing JDBC resources
  • When calling super methods

2. Don’t trust your early SPI evolution judgement

Providing an SPI to your consumers is an easy way to allow them to inject custom behaviour into your library / code. Beware, though, that your SPI evolution judgement may trick you into thinking that you’re (not) going to need that additional parameter. True, no functionality should be added early. But once you’ve published your SPI and once you’ve decided following semantic versioning, you’ll really regret having added a silly, one-argument method to your SPI when you realise that you might need another argument in some cases:

3. Avoid returning anonymous, local, or inner classes

Swing programmers probably have a couple of keyboard shortcuts to generate the code for their hundreds of anonymous classes. In many cases, creating them is nice as you can locally adhere to an interface, without going through the “hassle” of thinking about a full SPI subtype lifecycle.
But you should not use anonymous, local, or inner classes too often for a simple reason: They keep a reference to the outer instance. And they will drag that outer instance to wherevery they go, e.g. to some scope outside of your local class if you’re not careful. This can be a major source for memory leaks, as your whole object graph will suddenly entangle in subtle ways.

4. Start writing SAMs now!

Java 8 is knocking on the door. And with Java 8 come lambdas, whether you like them or not. Your API consumers may like them, though, and you better make sure that they can make use of them as often as possible. Hence, unless your API accepts simple “scalar” types such as int, long, String, Date, let your API accept SAMs as often as possible.
What’s a SAM? A SAM is a Single Abstract Method [Type]. Also known as a functional interface, soon to be annotated with the @FunctionalInterface annotation. This goes well with rule number 2, where EventListener is in fact a SAM. The best SAMs are those with single arguments, as they will further simplify writing of a lambda.

5. Avoid returning null from API methods

I’ve blogged about Java’s NULLs once or twice. I’ve also blogged about Java 8’s introduction of Optional. These are interesting topics both from an academic and from a practical point of view.
While NULLs and NullPointerExceptions will probably stay a major pain in Java for a while, you can still design your API in a way that users will not run into any issues. Try to avoid returning null from API methods whenever possible. Your API consumers should be able to chain methods whenever applicable:

6. Never return null arrays or lists from API methods

While there are some cases when returning nulls from methods is OK, there is absolutely no use case of returning null arrays or null collections! Let’s consider the hideous java.io.File.list() method.
Was that null check really necessary? Most I/O operations produce IOExceptions, but this one returns null. Null cannot hold any error message indicating why the I/O error occurred. So this is wrong in three ways:
  • Null does not help in finding the error
  • Null does not allow to distinguish I/O errors from the File instance not being a directory
  • Everyone will keep forgetting about null, here

7. Avoid state, be functional

What’s nice about HTTP is the fact that it is stateless. All relevant state is transferred in each request and in each response. This is essential to the naming of REST: Representational State Transfer. This is awesome when done in Java as well. Think of it in terms of rule number 2 when methods receive stateful parameter objects. Things can be so much simpler if state is transferred in such objects, rather than manipulated from the outside.

8. Short-circuit equals()

This is a low-hanging fruit. In large object graphs, you can gain significantly in terms of performance, if all your objects’ equals() methods dirt-cheaply compare for identity first:

9. Try to make methods final by default

Some will disagree on this, as making things final by default is quite the opposite of what Java developers are used to. But if you’re in full control of all source code, there’s absolutely nothing wrong with making methods final by default, because:
  • If you do need to override a method (do you really?), you can still remove the final keyword
  • You will never accidentally override any method anymore

10. Avoid the method(T…) signature

There’s nothing wrong with the occasional “accept-all” varargs method that accepts an Object... argument:
1
void acceptAll(Object... all);
Writing such a method brings a little JavaScript feeling to the Java ecosystem. Of course, you probably want to restrict the actual type to something more confined in a real-world situation, e.g. String.... And because you don’t want to confine too much, you might think it is a good idea to replace Object by a generic T:

Beginning with Swift: A Brief Intro to the New Programming Language



Swift is promoted as a "Fast, current, sheltered, intuitive" programming language. The language is simpler to learn and accompanies highlights to make programming more profitable. It appears to me Swift is intended to bait web engineers to construct applications.
Alongside the declaration of iOS 8 and Yosemite, Apple shocked all engineers in the WWDC by propelling another programming language called Swift. We appreciate programming in Objective-C however the dialect has demonstrated its age (which is currently 30 years of age) when contrasted with some cutting edge programming dialects like Ruby. Swift is promoted as a "Fast, current, sheltered, intuitive" programming language. The language is simpler to learn and accompanies highlights to make programming more profitable. It appears to me Swift is intended to bait web engineers to construct applications. The punctuation of Swift would be more well-known to web engineers. In the event that you make them programmed involvement with JavaScript (or other scripting dialects), it would be less demanding for you to get Swift as opposed to Objective-C.

In the event that you've viewed the WWDC keynote, you ought to be flabbergasted by a creative component called Playgrounds that enable you to test Swift and see the outcome continuously. At the end of the day, you never again need to aggregate and run your application in the Simulator. As you write the code in Playgrounds, you'll see the real outcome promptly without the overheads of gathering.

At the season of this composition, Swift has just been declared for seven days. In the same way as other of you, I'm new to Swift. I have downloaded Apple's free Swift book and played around with Swift a bit. Quick is a slick dialect and will make creating iOS applications more alluring. App Development Course in Bangalore In this post, I'll share what I've learnt up until now and the rudiments of Swift.

Variables, Constants and Type Inference

In Swift, you pronounce factors with the "var" watchword and constants utilizing the "let" catchphrase. Here is an illustration:
var   number Of Rows = 30
 let    max Number Of Rows = 100

These are the two catchphrases you have to know for variable and steady announcement. You just utilize the "let" catchphrase for putting away esteem that is unaltered. Something else, utilize "var" watchword for putting away esteem that can be changed.
Interesting that Swift enables you to utilize about any character for both variable and steady names. You can even utilize emoticon character for the naming:

Tip: You may consider how you can type emoticon character in Mac OS. It's simple. Simply squeeze Control-Command-spacebar and an emoticon picker will be shown.

You may see an enormous contrast in factor affirmation between Objective C and Swift. In Objective-C, engineers need to indicate expressly the sort data while pronouncing a variable. Be it an int or twofold or NSString, and so on.
It's your duty to determine the sort. For Swift, you never again need to comment on factors with write data. It gives a tremendous element known as Type deduction. The element empowers the compiler to conclude the sort consequently by looking at the qualities you give in the variable.

It makes variable and steady assertion significantly less complex, when contrasted with Objective C. Quick gives an alternative to you to unequivocally indicate the sort data on the off chance that you wish. The underneath case demonstrates to determine compose data while pronouncing a variable in Swift:

No Semicolons
In Objective C, you have to end every announcement in your code with a semicolon. On the off chance that you neglect to do as such, you'll wind up with a gathering blunder.
As should be obvious from the above cases, Swift doesn't expect you to compose a semicolon (;) after every announcement, however you can at present do as such on the off chance that you like.

Fundamental String Manipulation
In Swift, strings are spoken to by the String write, which is completely Unicode-consistent. You can announce strings as factors or constants:

In Objective C, you need to pick amongst NSString and NSMutable String classes to demonstrate whether the string can be changed. You don't have to settle on such decision in Swift. At whatever point you relegate a string as factor (i.e. var), the string can be adjusted in your code.

Swift improves string controlling and enables you to make another string from a blend of constants, factors, literals, and in addition, articulations. Linking strings is super simple. Basically include two strings together utilizing the "+" administrator:
Swift iOS Training Institutes in Bangalore naturally consolidates the two messages and you should the accompanying message in comfort. Note that printing is a worldwide capacity in Swift to print the message in support.

Dictionaries

Swift just gives two gathering writes. One is exhibits and the other is lexicons. Each incentive in a lexicon is related with a one of a kind key. In case you're comfortable with NSDictionary in Objective C, the linguistic structure of instating a lexicon in Swift is very comparative. Here is an illustration:

Objective C:
NSDictionary *companies = @{@"AAPL" : @"Apple Inc", @"GOOG" : @"Google Inc", @"AMZN" : @"Amazon.com, Inc", @"FB" : @"Facebook Inc"};

Swift:
var organizations = ["AAPL" : "Apple Inc", "GOOG" : "Google Inc", "AMZN" : "Amazon.com, Inc", "FB" : "Facebook Inc"]

The key and incentive in the key-esteem sets are isolated by a colon. Like cluster and different factors, Swift naturally identifies the sort of the key and esteem. Be that as it may, on the off chance that you like, you can indicate the sort data by utilizing the accompanying sentence structure:

Control Flow
Control stream and circles utilize an exceptionally C-like language structure. As should be obvious above, Swift accommodates in circle to emphasize through exhibits and lexicons. You can utilize if articulation to execute code in view of a specific condition. Here I'd quite recently get a kick out of the chance to feature the switch explanation in Swift which is much effective than that in Objective C.

Author:
Infocampus is your single source for iOS Training Institutes in Bangalore.
Infocampus is a Center of Excellence for iOS Technology Services, Learn iOS App Development Bangalore.
iOS App Development Course in Bangalore are available for those getting started and offer the perfect opportunity for you to get hands-on experience developing applications using the latest iOS technology.
Contact: 9738001024