Articles on Trending Technologies

Technical articles with clear explanations and examples

Private Constructors and Singleton Classes in Java Programming

Rishi Raj
Rishi Raj
Updated on 30-Jul-2019 2K+ Views

As we know the primary role of the constructor is to instantiate a class object now if we made the constructor as private then we restrict its calling to be only in defining a class and not in some other class. Now the singleton class in Java is defined as the class which restricts the instantiation of a class and ensure that only one instance of the class exists in the JVM. After first time if instantiate the singleton class the new variable also points to the first instance created. In order to create a singleton class we could use ...

Read More

Can Google Analytics track interactions in an offline HTML5 app?

Rishi Rathor
Rishi Rathor
Updated on 30-Jul-2019 263 Views

Google Analytics is a freemium analytic tool that provides a detailed statistics of the web traffic. It is used by more than 60% of website owners. Analytics Tools offer an insight into the performance of your website, visitors’ behavior, and data flow. These tools are inexpensive and easy to use. Sometimes, they are even free.If the application is offline, Google Analytics stores the events in an SQLite database.After storing, it waits until the user is online again to send them.It is used to collect offline latent hits. The value represents the time delta in milliseconds between when the hit occurs ...

Read More

How can we speed up Python "in" operator?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 630 Views

The python operator performs very badly in a list, O(n), because it traverses the whole list. You can use something like a set or a dict(hashed data structures that have very fast lookups) to get the same result in ~O(1) time!But this also depends on the type of data structure you're looking at. This is because while lookups in sets/dicts are fast, insertion may take more time than list. So this speedup really depends on the type.

Read More

Creating orders in SAP system using .Net

Sai Subramanyam
Sai Subramanyam
Updated on 30-Jul-2019 340 Views

You can handle it by creating an array and insert an object into Array. Bapisdhd1 order_header_in = new Bapisdhd1(); order_header_in.DocType = "OR"; order_header_in.CollectNo = "111022"; order_header_in.SalesOrg = "11011"; order_header_in.DistrChan = "100"; order_header_in.Division = "000"; order_header_in.DlvBlock = "010"; order_header_in.PurchNoC = "TEST ORDER"; newOrder.OrderHeaderIn = order_header_in;

Read More

Should a constructor always have the same name as the class in java?

Vikyath Ram
Vikyath Ram
Updated on 30-Jul-2019 3K+ Views

Yes, the constructor should always have the same name as the class. Constructor looks like method but it is not. It does not have a return type and its name is same as the class name. Mostly it is used to instantiate the instance variables of a class. If the programmer doesn’t write a constructor the compiler writes a constructors on his behalf. Example Live Demo public class Sample{ public Sample(){ System.out.println("This is a constructor"); } public static void main(String args[]){ Sample obj = new Sample(); } } Output This is a constructor

Read More

What is operator binding in Python?

Ankitha Reddy
Ankitha Reddy
Updated on 30-Jul-2019 590 Views

For expressions like − a == b first the python interpreter looks up the __eq__() method on the object a. If it finds that, then executes that with b as argument, ie, a.__eq__(b). If this method returns a NotImplemented, then it tries doind just the reverse, ie, it tries to call, b.__eq__(a)

Read More

Using client side XSLT transformations in HTML5

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 280 Views

Client-side XSLTProcessor API is part of the HTML5 scripting specification, as stated below:When an XSLT transformation program is triggered by a processing instruction and the browser implements a direct-to-DOM transformation, script elements created by the XSLT processor need to be marked "parser-inserted" and run in document oThe XSLTProcessor.transformToDocument() method adds elements to a Document that does not have a browsing context, and, accordingly, any script elements they create need to have their "already started" flag set in the prepare a script algorithm and never get executed (scripting is disabled). Such script elements still need to be marked "parser-inserted", though, such ...

Read More

How to optimize nested if...elif...else in Python?

Samual Sam
Samual Sam
Updated on 30-Jul-2019 1K+ Views

Here are some of the steps that you can follow to optimize a nested if...elif...else.1. Ensure that the path that'll be taken most is near the top. This ensures that not multiple conditions are needed to be checked on the most executed path.2. Similarly, sort the paths by most use and put the conditions accordingly.3. Use short-circuiting to your advantage. If you have a statement like:if heavy operation() and light operation():Then consider changing it toif lightOperation() and heavy operation():This will ensure that heavy operation is not even executed if the light operation is false. Same can be done with or ...

Read More

Use of Ionic as desktop web application with HTML5

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 304 Views

Ionic is an HTML5 Mobile App Development Framework targeted at building hybrid mobile apps. Think of Ionic as the front-end UI framework that handles all the look and feel and UI interactions your app needs to be compelling. Kind of like "Bootstrap for Native", but with the support for a broad range of common native mobile components, slick animations and a beautiful design. Ionic framework needs native wrapper to be able to run on mobile devicesIonic is built and tested for mobile only. Internet Explorer does not support all the features of Ionic. Use separate applications for desktop and mobile. However, you ...

Read More

Sum of all proper divisors of a natural number in java

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 564 Views

Following is the Java program which prints all the sum of all the divisors of a given number.

Read More
Showing 60561–60570 of 61,248 articles
Advertisements