Administrator

CSharp Interview Question: What is Action in CSharp

One of my friends called me after his interview as for a developer role in an esteemed organization. One of the question, interviewer asked him,

What is Action

 

After talking to him, I thought why not to blog about it? I am trying here to use minimum words and optimum code samples can be discussed with interviewer as answer of this question.

Action is type of delegate

  1. It returns no value.
  2. It may take 0 parameter to 16 parameters.

For example below Action can encapsulates a method taking two integer input parameter and returning void.

imgp10

So if you have method like below,

imgp9

You can encapsulate method Display in Action MyDelegate as below,

imgp8

An Action with one input parameter is defined in System namespace as below,

imgp7

Where in T is type of input parameter and T obj is value passed for the parameter.

Action with Anonymous method

You can work with Action and anonymous method as well. You can assign anonymous method to Action as below,

imgp6

Above code will print 9 as output.

Action with Lambda Expression

Like any other delegates, Action can be worked with lambda expression also as below,

imgp5

Above code will also print 9 as output.

Passing Action as input parameter

You can pass Action as parameter of a function also. Let us say you have a class

imgp4

And two functions called Display and Show to display Name and RollNumber of Student.

imgp3

Now you got a function where you need to pass either Display or Show. Or in other words you need to pass any function with the same signature of Display or Show. In that case you will be passing a delegate as input parameter to the function.

imgp2

You can call CallingAction method in Main as below,

imgp1

Above we are creating instance of Student class and one by one passing Display function and Show function as input parameter to CallingAction function. In CallingAction function, we are printing name of the function being passed as input parameter. On running you will get below output.

output action

I hope now you would be able to answer what is Action in simple words. I hope this post is useful. Thanks for reading.

 

Types of Constructor in .Net

Constructor is nothing but a function (with the same name as Class) and is used for initializing the members of a class whenever an class object is created. You can initialize the members with any value (as per member datatype) or with the default values through constructor.

If a class is not defined with the constructor then the CLR (Common Language Runtime) will provide an implicit constructor which is called as Default Constructor.

A class can have any number of constructors provided they vary with the number of arguments that are passed, which is they should have different signatures.

Some of the basic properties of Constructor are :

  1. Constructors do not return a value.
  2. Constructors can be overloaded.
  3. If a class is defined with static and Non-static constructors then the privilege will be given to the Non-static constructors.

Using the code

A. Public Constructor:

These are the most common, widely used and simple to implement constructors in Object Oriented Programming. The constructor is defined as public and get be called whenever a class is instantiated from external location of your program. Public Constructors is also known as default constructor of any class.

Also the Classes without a specified public constructor will have an implicit public constructor and maintained internally by CLR. Public constructor cannot be used in abstract class because public constructors always create instances of a type, and you cannot create instances of an abstract type.

[ads1]

using System;

class MyClass
{
 // defalut public constructor
 public MyClass()
 {
   Console.WriteLine("This is default constructor");
 }
 //public constructor with parameter
 public MyClass(int a)
 {
  Console.WriteLine("Value is "+a);
 }
}

class MyProgram
{
// start execution here from main method.
static void Main()
 {
 // initialize the class object
 MyClass myclass1 = new MyClass(); // default constructor
 MyClass myclass2 = new MyClass(5);
 Console.ReadLine();
 }
}

B. Protected Constructor:

A constructor is defined as protected in such cases where the base class will initialize on its own whenever derived types of it are created.

Means protected constructor is used with an abstract class where object initialization could not happen (because of abtract nature). The base class initialization happen only when derived class is initialized and call base class constructor.

 

public class Base
{
 protected Base() { }
 protected static void staticFoo() { }
 protected void instanceFoo() { }
}

public class Derived : Base
{
 Derived()
 : base() // initialize protected constructor through derived constructor
 { }
// start execution here from main method.
 void Main()
 {
  Base b = new Base(); // Compiler Error: Can not access protected member
  b.instanceFoo(); // Compiler Error: Can't call a protected instance method on a Base.
  Base.staticFoo(); // You call protected static method
  Derived d = new Derived();
  d.instanceFoo(); // Can call an inherited protected instance method on a Derived
  Derived.staticFoo(); // Can access static method of base class.
 }
}

C. Private Constructor :

Private constructor is a soul of Singleton pattern and used whenever we have to restrict the initializatio of class using ‘new’ keyword from outside world. The private modifier is usually used explicitly to make it clear that the class cannot be instantiated.

A private constructor is a special instance constructor. It is commonly used in classes that contain static members only. If a class has one or more private constructors and no public constructors, then other classes (except nested classes) are not allowed to create instances of this class.

 

public class MyClass
{
 private MyClass() { } // Private constructor
 public static int iCount;
 public static int IncrementCount()
 {
  return ++iCount;
 }
}
class MyTestClass
{
 // start execution here from main method.
 static void Main()
 {
  MyClass myclass = new MyClass(); // Compiler Exception: Can't initialize class because of private constructor
  MyClass.iCount = 100; // static variable directly accessible and initialized
  MyClass.IncrementCount(); // Direct call to static method
  Console.WriteLine("New value: {0}", MyClass.iCount);
 }
}

Private constructor plays a very special role in singleton design pattern. Singleton class is same as static class and both are used relatively for similar purpose (to provide only one “instance”) but still they have major difference.

  1. Singletons class can implement interfaces or derive from useful base classes.

  2. Singleton class object can be use as a parameter which is not possible for Static class.

  3. Singletons can be handled polymorphically without forcing their users to assume that there is only one instance.

 

class Program
{
static void Main(string[] args)
{
// get the class object without initializing through 'new' keyword
MyClass instance = MyClass.Instance;
}
}
/// <summary>
/// Sealed class. Implemented through Singleton pattern.
/// </summary>
public sealed class MyClass
{
// The internal static valiable of class object
static readonly MyClass _instance = new MyClass();
/// <summary>
/// This is a private constructor, meaning no outsiders have access.
/// </summary>
private MyClass()
{
// initailize the internal variables
}
/// <summary>
/// The Instance object of an MyClass class.
/// Return the _instance object everytime whenever the MyClass class is initialized.
/// </summary>
public static MyClass Instance
{
 get { return _instance; }
}
}

D. Static Constructor :

A static constructor is used to initialize any static data, or to perform a particular action that needs to be performed only once.

It is called automatically before the first instance is created or any static members are referenced. Static Constructor is special in nature as a static constructor does not take access modifiers or have parameters and can’t access any non-static data member of a class.

A static constructor cannot be called directly and the user has no control on when the static constructor is executed in the program.

A static constructor is called automatically to initialize the class before the first instance is created or any static members are referenced. The static constructors are basically useful when creating wrapper classes for unmanaged code.

 

class Program
{
 static void Main(string[] args)
 {
 MyClass.foo(); // call the static member directly
 MyClass myclass = new MyClass();
 myclass.foo(10);
 Console.ReadLine();
 }
}

public class MyClass
{
 static int a;
 int b;
 // Static constructor:
 static MyClass()
 {
  a = 10; // initialize the static variable
  //b = 20; // Compile Exception : non-static member can't be access through static constructor
  Console.WriteLine("I am in static constructor");
 }
 // non-static constructor
 public MyClass()
 {
  a = 10; // non-static constructor can initialize both static and non-static members
  b = 20;
  Console.WriteLine("I am in non-static constructor");
 }
 public static void foo()
 {
  Console.WriteLine("I am in static foo");
 }
 public void foo(int a)
 {
  Console.WriteLine("I am in non-static foo");
 }
}

Something More

Constructor Overloading : A constructor with zero arguments is known as the default constructor. A constructor can take zero or more arguments as parameters. The program have multiple constructors in a class with different sets of signatures. Such constructors are known as “overloaded constructors”. The overloaded constructors of a class must differ in their number of arguments, type of arguments, and/or order of arguments. This gives the user the ability to initialize the object in multiple ways.

The class in the program shown below contains three constructors. The first is the default constructor, followed by the two argument constructors. Note that the constructors differ in their signature.

using system;
public class MyClass
{
 public MyClass()
 {
 //Default constructor
 }
 public MyClass(int sampleValue)
 {
 // This is the constructor with one parameter.
 }
 public MyClass(int firstValue, int secondValue)
 {
 // This is the constructor with two parameters.
 }
}

Constructor Chaining : 

Constructor chaining refers to the ability of a class to call one constructor from another constructor. In order to call one constructor from another, we use base (parameters) or : this (parameters) just before the actual code for the constructor, depending on whether we want to call a constructor in the base class or in the current class.

using system;
public class MyClass
{
public MyClass(): this(10)
{
// This is the default constructor
// calling base class constructor and passing value 10 as parameter
}
public MyClass(int firstValue)
{
// This is the constructor with one parameter.
}
}

Conclusion

The best practice is to always explicitly specify the constructor, even if it is a public default constructor. Proper design of constructors goes a long way in solving the challenges faced in class designs.

 

Something You Are : Fingerprint

Fingerprint

 

Since people forget things and lose things, one might contemplate basing an authentication scheme for humans on something that a person is. After all, we recognize people we interact with not because of some password protocol but because of how they look or how they sound — “something they are”. Authentication based on “something you are” will employ behavioral and physiological characteristics of the principal. These characteristics must be easily measured accurately and preferably are things that are difficult to spoof. For example, we might use

  • Retinal scan
  • Fingerprint reader
  • Handprint reader
  • Voice print
  • Keystroke timing
  • Signature

To implement such a biometric authentication scheme some representation for the characteristic of interest is stored. Subsequently, when authenticating that person, the characteristic is measured and compared with what has been stored. An exact match is not expected, nor should it be because of error rates associated with biometric sensors. (For example, fingerprint readers today normally exhibit error rates upwards of 5%.)

Methods to subvert a fingerprint reader give some indication of the difficulties of deploying unsupervised biometric sensors as the sole means of authenticating humans. Attacks include:

    • Steal a finger. Difficult to do without the owner of the finger noticing. Good supervision of the biometric sensor defends against this attack. 
    • Steal a fingerprint. Lifting a fingerprint is not that hard (at least, according to those TV crime-drama shows). Again, though, good human supervision of the biometric sensor defends against this attack because a guard will notice if somebody is not inserting a naked finger into the reader. 
    • Replace the biometric sensor. At first glance, this type of attack might seem even more difficult to execute than the two above. Social enginnering might be easier for the attacker to employ, here, though. It suffices that the guard believe that the senor should be changed (maybe because the the old one is “broken”).

 

There are several well known problems with biometric-based authentication schemes:

  • Reliability of the method. Similarity of physical features (faces, hands, or fingerprints) and inaccuracy of measurement may together conspire to create an unacceptably high false acceptance rate (FAR). 
  • Cost and availability. Currently, some readers cost $40-50 and more. Are end users willing to pay that much for an authentication method that does not work as well as passwords? 
  • Unwillingness or inability to interact with biometric input devices. Some people are uncomfortable putting a body part into a machine; some are uncomfortable having lasers shined in their eyes for a retinal scans; and some don’t have fingers or eyes to be measured. 
  • Compromise the biometric database or system. It might be possible to circumvent the system’s biometric sensor and provide an “input” from another source. The sensor is, after all, connected to a system and hijacking that channel might be possible. Knowledge of the stored representation for a characteristic would then allow an attacker to inject the correct characteristic and impersonate anyone. 
  • Revocation. What does it mean to revoke a fingerprint?

The literature on biometric authentication uses the following vocabulary to characterize what a scheme does and how well it works:

    • FAR: (false acceptance rate). This is the probability that the system will fail to reject an impostor (aka FMR: false match rate)

 

    • FRR: (false reject rate). This is the probability that the system will reject a bona fide principal. (aka FNMR: false non-match rate)

 

    • One-to-one matching: Compare live template with a specific stored template in the system. This corresponds to authentication.

 

  • One-to-many matching: Compare live templates with all stored templates in the system. This corresponds to identification.

iPhone 6 Screen Looks Nearly Indestructible

Apple fans, here’s a new reason to get excited: The screen on the next iPhone appears to be much less likely to shatter into a million pieces.

Marques Brownlee, a popular YouTube host who was once called “the best technology reviewer on the planet” by a Google executive, purportedly got his hands on a front panel from the so-called “iPhone 6.”

It’s supposedly made with a much-hyped display material called sapphire crystal. Apple already uses a small amount of sapphire glass for the “Home” button and camera lens in the iPhone 5S, but the rest of the front display is made of Gorilla Glass — a product Apple has been using for years and appears ready to abandon when it releases a new phone this fall.

The new glass display is “paper thin,” Brownlee said in his video.

We were already pretty sure the glass was going to be thinner, more flexible and more durable than previous iterations, but Brownlee put those claims to the test by running the display through a gauntlet of scratches and twists. He stabbed the panel with a knife, scratched it with a set of keys and bent the screen 90 degrees — all without damaging the glass.

“I slowly realized there is absolutely no way I can break this display under my own power,” he said. “The worst blemish on the surface was actually my fingerprint marks and the dust from handling it so much.”

The glass is also extremely high-quality, Brownlee noted: “There’s absolutely no color shift while looking through the sapphire glass.”

Brownlee credited well known Apple rumormonger Sonny Dickson, who recently made his own video showcasing sapphire glass’s bendiness, for giving him the screen.

Brownlee’s screen measures 4.7 inches diagonally, keeping with rumors that Apple will release two different-sized iPhones this year: A 4.7-inch model and 5.5-inch one. Apple is thought to be going big to stay competitive with the increasingly popular large smartphones sold by Samsung and others.

Watch Brownlee’s entire video below:

Facebook buys video ad technology firm

Facebook A Large User Base

Facebook has acquired LiveRail – a tech start-up that helps companies place more relevant ads in the videos that appear on their websites and apps.

LiveRail also provides a real-time bidding platform for marketers looking to place ads on online videos.

The firms did not reveal the financial terms, but some reports indicate that Facebook paid between $400m and $500m (£233m and £291m) to buy the firm.

Online video advertising is forecast to grow robustly in the coming years.

“More relevant ads will be more interesting and engaging to people watching online video, and more effective for marketers too,” Brian Boland, vice president of ads product marketing and atlas at Facebook,said in a blog post.

“Publishers will benefit as well, because more relevant ads will help them make the most out of every opportunity they have to show an ad.”

According to LiveRail, it delivers more than seven billion video ads per month.

Growing importance

The online and mobile ad sector has been growing rapidly in recent years.

According to a study published in April, more than £1bn was spent on mobile ads in the UK alone in 2013, a rise of 93% on the previous year.

Some other estimates suggest that online video advertising revenues are likely to hit $6bn in the US this year.

As a result, a growing number of firms – especially social networking platforms such as Facebook and Twitter – have been looking at ways to attract more advertisers and tap into the sector’s growth.

Earlier this year, Facebook said it would start serving ads to third-party mobile apps via a new advertising network.

Twitter, acquired MoPub mobile advertising exchange last year.

MoPub acts as a mediation service, allowing marketers to manage the placement of ads across several networks, including Facebook’s.

Analysts said that given their large user base, social networks were likely to get a big share of this growing market.

“It is no longer about saying, ‘My ad was was seen by so many people,'” said Sanjana Chappalli, Asia-Pac head of LEWIS Pulse, a firm specialising in digital marketing.

“But it is now about knowing who those people are and how they have responded to the information fed to them.

“And on that front, social networks enjoy a tremendous advantage over everyone else.” she added.

Meanwhile, Google’s AdMob and Apple’s iAds platforms and several other smaller firms are also competing to provide the adverts shown on mobile phones and tablets.

Millennial Media, Flurry and Nexage are among the firms promoting their own versions of “programmatic buying” – a way for firms to target their ads at a specific type of consumer via a chosen type of app at an appropriate time and geographic location.

ISPs take legal action against GCHQ

GCHQ and the NSA's spying work is under legal scrutiny
GCHQ and the NSA’s spying work is under legal scrutiny

Seven internet service providers have filed a legal complaint against the UK’s intelligence agency GCHQ.

ISPs from the US, UK, Netherlands and South Korea have joined forces with campaigners Privacy International to take the agency to task over alleged attacks on network infrastructure.

It is the first time that GCHQ has faced such action.

The move follows allegations about government snooping made by US whistleblower Edward Snowden.

‘Infected with malware’

The ISPs claim that alleged network attacks, outlined in a series of articles in Der Spiegel and the Intercept, were illegal and “undermine the goodwill the organisations rely on”.

The allegations that the legal actions are based on include:

  • claims that employees of Belgian telecommunications company Belgacom were targeted by GCHQ and infected with malware to gain access to network infrastructure
  • GCHQ and the US National Security Agency, where Mr Snowden worked, had a range of network exploitation and intrusion capabilities, including a “man-on-the-side” technique that covertly injects data into existing data streams to create connections that will enable the targeted infection of users
  • the intelligence agencies used an automated system, codenamed Turbine, that allowed them to scale up network implants
  • German internet exchange points were targeted, allowing agencies to spy on all internet traffic coming through those nodes

While the ISPs taking the action were not directly named in the leaked Snowden documents, Privacy International claims that “the type of surveillance being carried out allows them to challenge the practices… because they and their users are at threat of being targeted”.

Privacy International has previously filed two other cases – the first against alleged mass surveillance programmes Tempora, Prism and Upstream, and the second against the deployment by GCHQ of computer intrusion capabilities and spyware.

‘Strict framework’

Eric King, deputy director of Privacy International, said “These widespread attacks on providers and collectives undermine the trust we all place on the internet and greatly endangers the world’s most powerful tool for democracy and free expression.”

The ISPs involved in the action are UK-based GreenNet, Riseup (US), Greenhost (Netherlands), Mango (Zimbabwe), Jinbonet (South Korea), May First/People Link (US)and the Chaos Computer Club (Germany).

Cedric Knight, of ISP GreenNet, added: “Snowden’s revelations have exposed GCHQ’s view that independent operators like GreenNet are legitimate targets for internet surveillance, so we could be unknowingly used to collect data on our users. We say this is unlawful and utterly unacceptable in a democracy.”

GCHQ maintains that all its work is conducted “in accordance with a strict legal and policy framework which ensures that our activities are authorised, necessary and proportionate”.

Tibetan altitude gene inherited ‘from extinct species’

Tibetan altitude gene

A gene that allows present-day people to cope with life at high altitude was inherited from an extinct species of human, Nature journal has reported.

The variant of the EPAS-1 gene, which affects blood oxygen, is common in Tibetans – many of whom live at altitudes of 4,000m all year round.

The DNA sequence matches one found in an extinct group called the Denisovans.

Many of us carry DNA from extinct humans who interbred with our ancestors as the latter expanded out of Africa.

Both the Neanderthals – who emerged around 400,000 years ago and lived in Europe and western Asia until 35,000 years ago – and the enigmatic Denisovans contributed DNA to present-day people.

The Denisovans are known only from DNA extracted from the finger bone of a girl unearthed at Denisova Cave near the Altai Mountains in Siberia. This 40,000-50,000-year-old bone fragment, as well as a rather large tooth from another individual, are all that is known of this species.

The tiny “pinky” bone yielded the entire genome sequence of the ancient girl it belonged to, allowing scientists to compare it to the genetic sequences of modern people in order to better understand the legacy of ancient interbreeding.

Now, researchers have linked an unusual variant of the EPAS1 gene, which is involved in regulating the body’s production of haemoglobin – the molecule that carries oxygen in the blood – to the Denisovans. When the body is exposed to the low oxygen levels encountered at high elevations, EPAS1 tells other genes in the body to become active, stimulating a response that includes the production of extra red blood cells.

The unusual variant in question is common among Tibetans and probably spread under natural selection after they moved onto the high-altitude plateau in Asia several thousand years ago.

“We have very clear evidence that this version of the gene came from Denisovans,” said principal author co-author Rasmus Nielsen, from the University of California, Berkeley.

A tiny finger bone provided a high-quality DNA sequence for a new species

Prof Nielsen told : “If you and I go up to high altitude, we’ll immediately have various negative physiological effects. We’ll be out of breath, we might suffer from altitude sickness.

“After a little while, we’ll try to compensate for this by producing more red blood cells. But because we’re not adapted to the high altitude environment, our response would be maladaptive – we would produce too many red blood cells.

“The blood becomes too thick and raises our blood pressure, placing us at risk of stroke and pre-eclampsia (in pregnant women).”

But Tibetans are protected against these risks by producing many fewer red blood cells at high altitude. This keeps their blood from thickening.

The Tibetan variant of EPAS1 was discovered by Prof Nielsen’s team in 2010. But the researchers couldn’t explain why it was so different from the DNA sequences found in all other humans today, so they looked to more ancient genome sequences for an answer.

“We compared it to Neanderthals, but we couldn’t find a match. Then we compared it to Denisovans and to our surprise there was an almost exact match,” said Prof Nielsen.

He says the interbreeding event with Denisovans probably happened a very long time ago.

“After the Denisovan DNA came into modern humans, it lingered in different Asian populations at low frequencies for a long time,” Prof Nielsen explained.

“Then, when the ancestors of Tibetans moved up to high altitudes, it favoured this genetic variant which then spread to the point where most Tibetans carry it today.”

He says it remains unclear whether the Denisovans were also adapted to high altitude. Denisova Cave lies at an elevation of 760m – not very high. But it is close to the Altai Mountains which rise above 3,000m.

He said it was a clear and direct example of humans adapting to new environments through genes acquired via interbreeding with ancient human species.

There are other hints of this. Previous research has shown that ancient humans introduced genes that may help us cope with viruses outside Africa.

And a study of Eurasian populations showed that Neanderthal DNA is over-represented in parts of the genome that are involved with making skin, hair and nails, which may have been advantageous in the novel climatic conditions they encountered.

Something You Have : Card System

Smart Card

Instead of basing authentication on something a principal knows and can forget, maybe we should base it on something the principal has. Various token/card technologies support authentication along these lines. For all, 2-factor authentication becomes important — an authentication process that involves 2 independent means of authenticating the principal. So, we might require that a principal not only possess a device but also know some secret password (often known as a PIN, or personal identification number). Without 2-factor authentication, stealing the device would allow an attacker to impersonate the owner of the device; with 2-factor authentication, the attacker would still have another authentication burden to overcome.

Here are examples of technologies for authentication based on something a principal might possess:

  • A magnetic strip card. (eg. Cornell ID, credit card) One serious problem with these cards is that they are fairly easy to duplicate. It only costs about $50 to buy a writer, and it’s easy to get your hands on cards to copy them. To get around these problems, banks implement 2-factor authentication by requiring knowledge of a 4 to 7 character PIN whenever the card is used. Magnetic Strip CardShort PINs are problematic. First, they admit guessing attacks. Banks defend against this by limiting the number of guesses before they will confiscate the card. Second there is the matter of how to check if a PIN that has been entered is the correct one. Storing the PIN on the card’s magnetic stripe is not a good idea because a thief who steals the card can easily determine the associated PIN (and then subvert the 2-factor authentication protocol). Storing an encrypted copy of the PIN on the card’s magnetic stripe does not exhibit this vulnerability, though.
  • Proximity card or RFID. These cards transmit stored information to a monitor via RF. There is currently a debate in this country as to the merits of using RF proximity cards (RFID tags) for identification of people and products. Walmart speaks about puttung RFID tags on every product they shelve, and both the German and U.S. governments are including them in passports. With RFID tags on Walmart products, for example. then somebody with a suitable receiver could tell what you have purchased (even though your purchase is hidden in a bag) — and this is seen by some as a privacy violation. With RFID tags in passports, somebody with a suitable receiver could remotely identify on the street citizens of a given country and single them out for “special treatment” (likely unpleasant). RFID CardThere are two types of RF proximity cards: passive and active. The former is not powered, and use the RF energy from the requester to reply with whatever information is being stored by the card. The latter is powered and broadcasts information, allowing anyone who is in range and has a receiver to query the card. You could imagine that if RF tags are put into passports, then some people might start carrying them in special Faraday-cage passport holders, because now an interloper can learn about someone without the victim’s knowledge (or permission).
  • Challenge/Response cards and Cryptographic Calculators. These are also called smart cards and perform some sort of cryptographic calculation. Sometimes the card will have memory, and sometimes it will have an associated PIN. A smart card transforms the authentication problem for humans, because we are no longer constrained by stringent computational and storage limitations. Unfortunately, today’s smart cards are vulnerable to power-analysis attacks. Furthermore, one must exercise care in using a cryptographic calculator — if it is used to generate digital signatures, for example, then somehow the device owner must be made aware of what documents are being signed. Smart CardOne prevalent form of smartcard is the RSA secure id. It continuously displays encrypted time; and each RSA secure id encrypts with a different key. Whoever has an RSA secure id card responds to server challenges by typing the encrypted time (so, in effect, it is secret) — a server, knowing what key is associated with each user’s card, can then authenticate a user. (The server must be somewhat generous with respect to what times it will accept. Accept too many and replay attacks become possible; accept too few and message delivery delays and execution times prevent people from authenticating themselves).

WiFi World Wide a Big Security Issue

WiFi World Wide a Big Security Issue

Do you access your various financial or social media accounts, or other private accounts such as emails with your doctor, at public computer stations? At the coffee house or hotel, for instance? Boy, are you ever setting yourself up for cybercrime including identity theft.

 

What usually happens is that the criminals establish Wi-Fi hotspots that trick people into thinking they are legitimate public Wi-Fi locations–people take the bait and log on. The crooks can then watch your communications through their Wi-Fi access points, and steal your personal information like passwords and credit card numbers.

A computerweekly.com report warns that anything you send via a public Wi-Fi may potentially fall into the hands of fraudsters.

One of the scams is that a criminal will get in the middle of a transaction between a user and a website, then intercept in tricky ways to steal the user’s data.

A Few Experiments

  • The security firm, First Base Technologies, did an experiment in November 2013. The public participants had no idea that thieves could set up rogue wireless points of access that fake out users as being valid connection points.
  • The participants were also shocked to learn that their exchanged information was not encrypted.
  • FBT did another experiment using its private wireless network and numerous mobile applications. FBT was easily able to use the apps to invade other smartphones on the same network.
  • One of these apps was a setup to get the participants to use the “attacking” smartphone as their portal to the Internet. This meant that the attacking device siphoned all the traffic and was able, in many instances, to remove encryption from supposedly secure connections.

This weakness in knowledge in the user, and in the security of public Wi-Fi, needs to be addressed by–obviously–the user and the providers of public Wi-Fis, plus business organizations that rely on public Wi-Fis.

Another survey in the same article found that 34 percent of PC users said that they do not take special precautions to safeguard their online interactions when using public Wi-Fi. Just 13 percent do take the time to inspect encryption prior to making a connection to a particular point.

So how can you protect yourself when using public Wi-Fi?

  • If you must absolutely use public Wi-Fi for activities involving highly sensitive information, make sure that the Wi-Fi network is secure and trusted.
  • Before you get onto any website, check the URL field to make sure that there is an “https” (not “http”) AND a padlock icon; these indicate the site is secure. Also check the security certificate.
  • Make sure that every device that you own has full protection such as antivirus and a firewal.
  • Use a reputable virtual private network such as Hotspot Shield to secure your device for public Wi-Fi use.

What Music Do Animals Like?

Patrick Kicken | flickr
Patrick Kicken | flickr

Research published today by the American Psychological Association has shownthat chimpanzees prefer listening to West African akan and North Indian raga over listening to silence. What does this say about the evolutionary purpose of music?

Previous work by McDermott and Hauser showed that when tamarins and marmosets were given a choice between a lullaby played on a flute, an excerpt of German techno, or silence, they preferred silence. This new research was investigating whether non-Western music might provoke a different response in nonhuman primates. Would the different rhythmic structures and musical scales in non-Western music change preferences?

The study played African, Indian, and Japanese music near large chimp enclosures and looked at whether the animals spent time in places where the music was loud and clear or in places further from the loudspeakers, where it was quiet or inaudible. For African and Indian music the chimps spent significantly more time in places where the music could be heard. For Japanese music they more often went to places where the music was difficult or impossible to hear.

The researchers think the preference may be due to the rhythmic content of the music. The African and Indian pieces didn’t have an obvious pulse to them that you could tap your foot along to, whereas the Japanese music had a strong regular pulse.

Study co-author Frans de Waal, Ph.D., of Emory University, commented, “Chimpanzees may perceive the strong, predictable rhythmic patterns as threatening, as chimpanzee dominance displays commonly incorporate repeated rhythmic sounds such as stomping, clapping and banging objects.”

One reason for this sort of study is to try to understand the evolutionary basis for music. Experimental psychologist Steven Pinker famously described music as “auditory cheesecake,” something that is pleasurable but has no adaptive function, arising as a byproduct of other evolutionary pressures, like the pressure that led to the development of language. But if music is purely a byproduct of the pressures that led to language, then why would chimpanzees show a preference for some types of music?

The number of scientific papers looking into the role of rhythm in music is surprisingly small. This bias is something that needs addressing if we are to fully understand why we make and love music.