Wednesday, 24 December 2014

Slider in CSS and HTML without javascript and jquery.


This is improved version of the slider which was presented in the previous article.
The new version of the slider has only a couple of changes, so there is no need to describe the old slider code, only the changes. Here is the description of the old slider code:creating an image slider using only CSS3.



The current slider has three advantages in comparison with the old one:
  1. There is no page scrolling while clicking the navigation buttons.
  2. Now the default image also has full animation when you first time switch between images using navigation buttons.
  3. In HTML, one element was removed to make it simpler ("slide-frame" element).
To prevent page scrolling, the targeted elements were changed from img to div tags, where div elements are placed in the same parent element as img elements (here parent element is tag div with id "slides"). Every divelement has its own neighbor - img element.
All div elements have two CSS properties:
  1. display with value none to hide all div elements. They don't need to be displayed, because they are only used for targeting by :targed selector.
  2. position with value fixed to turn off page scrolling. All elements with such position are positioned relative to the browser window, that is the reason why page scrolling stops working and that's what we wanted in the first place.
When div element is targeted by :target selector, the special CSS styles are applied to its neighboring imgelement which goes right after the current div element. That's the whole trick!
Here is a part of CSS code which is used to get the result:
The following CSS code displays the default image with class "default" which has to be shown when none of the images hasn't yet been selected by the navigation buttons. Meanwhile, this CSS code hides the default image when one of images is selected by the navigation buttons.

Here is the full HTML and CSS code for the new slider.
HTML code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Slider in css </title>
<style type="text/css">
#image-slider {
  margin: 100px auto;
  width: 700px;
}

#navigation {
  margin: 5px 0 0 0;
  text-align: center;
  z-index: 10;
}

#navigation a {
  text-decoration: none;
  background: #003C72;
  padding: 2px 6px;
  color: #FFFFFF;
  display: inline-block;
  border-radius:25px;

}

#navigation a:hover {
  background: #0182C4;
}

#slides {
  height: 375px;
  overflow: hidden;
  position: relative;
}

#slides img {
  position:absolute;
  top: 0;
  left: -500px;
}

#slides img {
  z-index: 1;
  opacity: 0;
  /* animation */
  transition: all linear 400ms;
  -o-transition: all linear 400ms;
  -moz-transition: all linear 400ms;
  -webkit-transition: all linear 400ms;
}
#slides div {
  display: none;
  position: fixed;
}
#slides div:target + img {
  left: 0;
  z-index: 5;
  opacity: 1;
}

#slides img.default {
  left: 0;
  z-index: 5;
  opacity: 1;
}

#slides div:target ~ img.default {
  z-index: 1;
  opacity: 0;
  left: -500px;
}

.image .text {
    position:absolute;
    top:10px;
    left:10px;
    width:300px;
}

</style>
</head>

<body>

<div id="image-slider">
  <div id="slides">
    <div id="slide1"></div>
   
    <img src="nature1.jpg" alt="" />
 
    <div id="slide2"></div>
 
    <img src="nature2.jpg" alt="" />
  
    <div id="slide3"></div>
    <img src="nature3.jpg" alt="" />
   
    <div id="slide4"></div>
    <img src="nature4.jpg" alt="" />
   
    <div id="slide5"></div>
    <img src="nature5.jpg" alt="" />
   
    <img class="default" src="nature1.jpg" alt="" />
  </div>
  <div id="navigation">
    <a href="#slide1">1</a>
    <a href="#slide2">2</a>
    <a href="#slide3">3</a>
    <a href="#slide4">4</a>
    <a href="#slide5">5</a>
  </div>
</div>
</body>

</html>

Tuesday, 23 December 2014

Top 10 Software Failures in 2014

Top 10 Software Failures in 2014.




10. Software Glitch Sends Bank Statements to the Wrong People

A Swiss bank found themselves in a pinch in early 2014 when they discovered that their software system had issued end-of-the-year bank statements addressed to the wrong people. Customers of the bank reported receiving, along with their own statement, a handful of statements containing details for other bank patrons. Uh oh. You may have received your correct information, but who else received it as well? Can’t assume everyone is as nice as you. 

9. Bar Exam Software Failure

In August of 2014 thousands of law students across the United States pressed “submit” on their completed exam files only to find that their tests were not being accepted by the software. None too surprisingly, the Bar Exam software now finds themselves facing multiple lawsuits filed by disgruntled would-be lawyers.

8. London Airspace Closed Due to Software Malfunction

Typically flights are canceled due to weather concerns – not software. Earlier this December an air traffic control center was forced to close London Airspace when the software managing the arrivals and departures began to malfunction. While the software was repaired and running again within record speed, the repercussions were far reaching. Heathrow reported canceling over 50 flights with multiple flights turned back to their originating destinations. 

7. Faulty Casino Software Targets Compulsive Gamblers

Self-identified “compulsive gamblers” registered on a do-not-contact list with an American based entertainment and gaming company in an attempt to avoid ads that would trigger their addiction. Unfortunately their good intentions backfired when a software glitch reversed the data and sent promotional gambling emails to the very people they were trying to avoid.

6. Software Glitch Accidentally Releases Prisoners

Over 20 inmates in Dallas, Texas, were mistakenly released this past June during a software transition. The local police force claims that incorrect information within the new system misled authorities into releasing inmates facing charges from property crime to domestic violence. Dallas police stated at the time that they are working to relocate and arrest the felons. 

5. Software Error Assigns Wrong Pictures to Drivers’ Licenses

Several Arizona residents received drivers’ licenses this summer that contained all the correct information…except for the picture. Investigating the issue, the problem was linked back to the camera-computer connection being used to take the license pictures – a delay in transferring the saved image resulted in the photographs being attached to the previous person’s file…and thus Jane received a license looking very much like a Bob. That is a lot worse than a bad hair day. 

4. Software Malfunction Prevents Callers from Reaching 911

A third party call center that directs and assigns calls to the 911 emergency line reported a software malfunction that caused thousands of calls for help to drop on April 9th. According to reports the software used to track and assign the calls had a built-in counter that maxed out at 40 million calls. Once the 40 millionth call had been placed, the calls bottlenecked cutting off over 11 million people in over seven states from the emergency hotline. 

3. Thieves Leverage Software Override to Clean Out Casinos

A software override code for a specific brand of video ROULETTEhttp://cdncache1-a.akamaihd.net/items/it/img/arrow-10x10.png machines was released online, prompting a coordinated group of thieves to pull off an Ocean’s Eleven-worthy heist. According to reports, the override code caused the machines to dispense money when the numbers 1-9-3-6 were pressed before pulling the lever. The robbery targeted hundreds of casinos across Germany, some casinos losing as much as €100,000 in a night. 

2. Airline Software Flaw Makes Boarding Passes Accessible to Public

An international airline recently discovered a software security flaw that allows anyone with a computer and valid URL to access (and potentially change) flight boarding passes. While the airline was able to quickly issue a fix and does not believe that flight security has been compromised, the issue does raise the question of data security as air travel becomes increasingly reliant on software programs to manage their complexities. 

1. Error in Bitcoin Software Leads to Market Crash

As of February 2014, Mt. Gox, a Bitcoin exchange company based in Japan, closed its doors after declaring bankruptcy, saying it could not account for its $474 million in Bitcoin and customer INVESTMENThttp://cdncache1-a.akamaihd.net/items/it/img/arrow-10x10.png. While questions still remain as to the cause of Mt. Gox’s dramatic collapse, suspicions swirl that the company had been slowly bleeding funds to hackers as a result of a previously discovered “transaction malleability” flaw in the software. 

Please Like our Facebook page for more reading material.” https://www.facebook.com/CodingForumBlog?ref=br_tf”

Introduction of Encapsulation and Abstraction and difference Between Encapsulation and Abstraction.


 What Encapsulation and Abstraction?




1  Encapsulation:

Encapsulation refers to the process of hiding or encapsulating the implementation details of an object. A washing machine is a good example of an encapsulated object.
We know that inside a washing machine are a whole series of complex electronics, however, we don ít need to be able to understand them to wash our clothes. In fact if the nitty gritty electronics were exposed to us we might even be afraid to use it and the washing machine would be more fragile and in danger of breaking down. 
This was one of the disadvantages of procedural programming; the user of the procedure
could break the procedure by giving it the wrong type of data.

In terms of our concept of an object, encapsulation hides the properties, some methods, all method implementation details of an object from the outside. For example, the velocity of a car cannot be magically changed, we have to press the accelerator or brake (methods that we don't  need to know the details of), in this respect the velocity of the car is hidden from outside interference, but can be changed by visible
methods.

An interface is a simple control panel that enables us to use an object. In the case of a washing machine the interface consists of the powder drawer, the door, the program knob and the on/o§ switch. For a car we have the steering wheels, clutch, brake accelerator etc. The great benefit  of the interface is that we only need to understand the simple interface to use the washing machine or car in order to use them. This is much easier than understanding the internal implementation details.


Another benefit is that the implementation details can be changed and we can
still use the car or washing machine. For example, Suppose your car breaks down and
you take it to the garage and they replace the engine with a bigger and better engine.
The car operates in exactly the same way as the interface has remained constant.
Thus it is extremely important to design a good interface that will not change. The
inner workings can be tinkered with and cause no external operational aspect.
Taken together the encapsulation and interface concepts unite to produce another benefit. Once the user understands the interface, the implementation details.

2  Data Abstraction.

Abstraction is a general concept in computer science and means disregarding the
details of an implementation and focusing instead on the ideal being represented.
For example, consider what happens when you click on the print button in a word
processing application. It is possible to simply imagine some process which moves the
contents of the document to the printer, which then prints the document. It would
be complex and confusing to think about the actual software being executed on your
computer, the network server and the printer in order to perform printing. Instead,
an abstraction of the printing process is imagined.
Data abstraction is the process of creating an object whose implementation
details are hidden (i.e. encapsulated), however the object is used through a well defined interface. Data abstraction leads to an abstract data type (ADT).
 ADT is are objects whose implementation is encapsulated. For example, when you use a floating
point number in a program you don ít really care exactly how it is represented inside
the computer, provided it behaves in a known manner. ADT is should be able to be used independent of their implementation meaning that even if the implementation changes the ADT can be used without modification.
Most people would be unhappy if they took their car to the garage for a service and
afterwards the mechanic said "She is running lovely now, but you will have to use the
pedals in reverse". If this were the case the car would not be an ADT. However, the
reality is that we can take a car to a garage for a major overhaul (which represents

a change of implementation) and still drive it in exactly the same way afterwards.

Thanks for visiting our site and please like our Facebook page. page: https://www.facebook.com/CodingForumBlog?ref=br_tf