What are the advantages of using REST in Web API?

You don't know the end user ( client ) stack. You are going to interface multiple systems. You want the cost benefit by offloading the task of platform specific integration up to the API consumers. You don't care how your API is consumed technically, say you published a set of guidelines to write best possible ... you want the universal presence with minimum efforts, given the fact that REST APIs are exposed as an HTTP Services, which is virtually present on almost all the platforms.

answered 21 Aug by muneshs16 asp.net 2 Answer(s) August 22, 2017

Explain how you can implement singleton pattern in .NET?

There are various ways to implement the Singleton Pattern in C#. The following are the common characteristics of a Singleton Pattern. A single constructor, that is private and parameterless. The class is sealed. A static variable that holds a reference to the single created instance, if any. A public static means of getting the reference to the single created instance, creating one if necessary.

answered 19 Aug by Roshan333 c# 2 Answer(s) August 20, 2017

How do I empty an array in JavaScript?

If you need to keep the original array because you have other references to it that should be updated too, you can clear it without creating a new array by setting its length to zero: A.length = 0;

answered 18 Aug by muneshs16 javascript 2 Answer(s) August 19, 2017

What are functional and non-functional requirements?

functional requirements are the main things that the user expects from the software for example if the application is a banking application that application should be able to create a new account, update the account, delete an account, etc. functional requirements are detailed and are specified in the system design Non-functional ... example for an banking application a major non-functional requirement will be availability the application should be available 24/7 with no down time if possible.

answered 17 Aug by muneshs16 c# 2 Answer(s) August 18, 2017

What are access modifiers?

They are access modifiers and help us implement Encapsulation (or information hiding). They tell the compiler which other classes should have access to the field or method being defined. private - Only the current class will have access to the field or method. protected - Only the current class and subclasses (and sometimes also same- ... class can refer to the field or call the method. This assumes these keywords are used as part of a field or method declaration within a class definition.

answered 16 Aug by muneshs16 oops 2 Answer(s) August 17, 2017

Why is Dictionary preferred over hashtable?

Dictionary <<<>>> Hashtable differences: Generic <<<>>> Non-Generic Needs own thread synchronization <<<>>> Offers thread safe version through Synchronized() method Enumerated item: KeyValuePair <<<>>> Enumerated item: DictionaryEntry Newer (> .NET 2.0) <<<>>> Older (since .NET 1.0) is in System.Collections.Generic <<<>> ... key throws exception <<<>>> Request to non-existing key returns null potentially a bit faster for value types <<<>>> bit slower (needs boxing/unboxing) for value types

answered 15 Aug by muneshs16 c# 2 Answer(s) August 16, 2017

What is Self Hosting in WCF?

We can host a WCF service in IIS and a Windows service also. A service can also be in-process, in other words the client and service are in the same process. Now let's create the WCF Service that is hosted in a console application.

answered 6 Aug by Roshan333 wcf 2 Answer(s) August 7, 2017

Java Strings: compareTo() vs. equals()

When comparing for equality you should use equals(), because it expresses your intent in a clear way. compareTo() has the additional drawback that it only works on objects that implement the Comparable interface. This applies in general, not only for Strings.

answered 5 Aug by muneshs16 java 2 Answer(s) August 6, 2017

What's the difference between IQueryable and IEnumerable

"The primary difference is that the extension methods defined for IQueryable take Expression objects instead of Func objects, meaning the delegate it receives is an expression tree instead of a method to invoke. IEnumerable is great for working with in-memory collections, but IQueryable allows for a remote data source, like a database or web service"

answered 4 Aug by Govind123 c# 2 Answer(s) August 5, 2017

How do I select a C# variable using a string

The simplest way is probably to just use GetField. Using your example just change the last line to: var selectedField = MyApp.Settings.Default.UserSelectedInt public int myInt = (int) GetType().GetField(selectedField).GetValue(this); If the field or class is static the syntax should be: var selectedField = MyApp. ... = (int)typeof(YourClass).GetField(selectedField).GetValue(null); See http://msdn.microsoft.com/en-us/library/system.reflection.fieldinfo.getvalue.aspx for more details.

answered 14 Aug by muneshs16 c# 2 Answer(s) August 15, 2017

What is Piggy Backing?

Piggybacking, in a wireless communications context, is the unauthorized access of a wireless LAN. Piggybacking is sometimes referred to as "Wi-Fi squatting." The usual purpose of piggybacking is simply to gain free network access rather than any malicious intent, but it can slow down data transfer for legitimate users of ... network that is vulnerable to piggybacking for network access is equally vulnerable when the purpose is data theft, dissemination of viruses, or some other illicit activity.

answered 2 Aug by muneshs16 networking 2 Answer(s) August 3, 2017

What is deadlock?

Maybe a simple bank situation. class Account { double balance; void withdraw(double amount){ balance -= amount; } void deposit(double amount){ balance += amount; } void transfer(Account from, Account to, double amount){ sync(from); sync(to); from.withdraw(amount); to.deposit(amount); release(to); release(from); } } ... then a deadlock is going to occur because they try to acquire the resources in reverse order. This code is also great for looking at solutions to the deadlock as well.

answered 13 Aug by muneshs16 java 2 Answer(s) August 14, 2017

What is the difference between “INNER JOIN” and “OUTER JOIN”?

Inner join - An inner join using either of the equivalent queries gives the intersection of the two tables, i.e. the two rows they have in common. Left outer join - A left outer join will give all rows in A, plus any common rows in B. Full outer join - A full outer join will give you the union of A and B, i.e. All the rows in A and all the rows in B. If something in A doesn't have a corresponding datum in B, then the B portion is null, and vice versa

answered 12 Aug by muneshs16 sqlserver 2 Answer(s) August 13, 2017

What are Pros and Cons of automating tests at UI layer ?

Unit Tests: (+) Keeps testing close to the relevant code (+) Relatively easy to test all code paths (+) Easy to see if someone inadvertently changes the behavior of a method (-) Much harder to write for UI components than for non-GUI Integration Tests: (+) It's nice to have nuts and bolts in a project, ... < length of array. What happens when outside bounds? Should method throw exception or return null? Integration test: What does the user see when a negative inventory value is input?

answered 11 Aug by muneshs16 testing 2 Answer(s) August 12, 2017

What is kernel? 

The technical definition of an operating system is "a platform that consists of specific set of libraries and infrastructure for applications to be built upon and interact with each other". A kernel is an operating system in that sense. The end-user definition is usually something around "a software package that provides a desktop, shortcuts to ... If most of them require only kernel, the kernel is the OS, if most of them require X Window System running, then your OS becomes X + kernel.

answered 9 Aug by LogenRahul operating systems 2 Answer(s) August 10, 2017

Define DB2 ?

DB2 is a Relational DataBase Management System (RDBMS) originally introduced by IBM in 1983 to run on its MVS (Multiple Virtual Storage) mainframe platform. The name refers to the shift from the then prevalent hierarchical database model to the new relational model. Although DB2 was initially designed to work exclusively ... s information management portfolio. It is a full-featured, high-performance database engine capable of handling large quantities of data and concurrently serving many users.

answered 8 Aug by muneshs16 ibm db2 2 Answer(s) August 9, 2017

What is "Protocol" on objective c?

Use the @optional keyword before your method declaration to make it optional. Simple as that! // myProtocol.h @protocol myProtocol - (void)myMandatoryMethod:(id)someArgument; @optional - (void)myOptionalMethod:(id)someArgument; @end // myClass.m @interface myClass : someSuperClass <myProtocol> //... @end

answered 7 Aug by muneshs16 objective c, ios 2 Answer(s) August 8, 2017

The best way to transform int[] to List in Java?

There's probably a built-in method to do it somewhere* (as you note, Arrays.asList won't work as it expects an Integer[] rather than an int[]). I don't know the Java libraries well enough to tell you where that is. But writing your own is quite simple: public static List<Integer> createList(int[] array) { List< ... return list; } Obviously one downside of this is that you can't do it generically. You'll have to write a separate createList method for each autoboxed primitive type you want.

answered 3 Aug by Govind123 java 2 Answer(s) August 4, 2017