Pages

Translate

Friday, 25 January 2013

poncho`s are not only for mexicans

                                               

                           
                Poncho`s are not only for mexicans

What is the first thing you think about when you hear...poncho???? mexicans??? sombrero? and southamerica???


if you had this kind of picture in your mind then i think its time that you know that there are alot of more than just this kind of ponchos:




Ponchos can be really fashionable and really stylish :) you dont believe me then take a look at this :


a cute poncho with a adorable bunny pouch  <3
where to buy ---> http://www.irregularchoice.com/shop/search/product/4024/pac-a-poncho.html?offset=1




This Poncho i saw at the yumetenbo onlineshop =) it seem really warm and gives me a cute (i love the big ribbon) but also a kinda elegant feeling when i look at it :)
where to buy--> http://global.rakuten.com/en/store/dreamv/item/510710/ (sadly it is sold out at the moment)


another poncho from yumetenbo ( yap i love this kind of clothes xD) This time its an bear ear hoodie poncho *o*
where to buy ---> http://global.rakuten.com/en/store/dreamv/item/510709/


This poncho is from H&M and i own this one by myself :D Its really cute and warm and fluffy *_* 

where to buy-----> they dont sell it in the h&m shops anymore...i bought mine on ebay :) so you also should take a look if someone sell it their :) i got mine for 5 euro there *yay*

 I hope you liked it again <3 and changed your mind about ponchos :)




Thursday, 24 January 2013

Tutorial 5 : Using an Object Interfaces


-->
saved as testing.php

<?php
//Define an interface that will allow conversion of objecs to strings
interface conversionOptions{
public function asString();
public function asHTML();
}
//Define a 'cat' class that implements the interface
class cat implements conversionOptions{
//Properties of a cat
public $name;
public $color;
//Constructor that requires a name
public function __construct($namesake){
$this->name=$namesake;
}
//implement the strung function of the interface
public function asString(){
return "Cat - Name:{$this->name},Color:{$this->color}";
}
//implement the HTML function of the interface
public function asHTML(){
return "<ul><li>Cat</li><ul><li>Name:{$this->name}</li>
<li>Color:{$this->color}</li></ul></ul>";
}
}
//Define class that implements the interface,for acronym definitions
class acronym implements conversionOptions{
//Properties of an acronym
private $name;
private $definition;
//Constructor that requires the term entry and definition
public function __construct($entry,$def){
$this->name=$entry;
$this->definition=$def;
}
//Implement the string function of the interface
public function asString(){
return "{$this->name}:{$this->definition}";
}
//Implementthe HTML function of the interface
public function asHTML(){
return "<dl><dt>{$this->name}</dt><dd>{$this->definition}</dd></dl>";
}
}
//Instatiate a cat & gie it data
$my_cat=new cat('Wiley');
$my_cat->color='grey tabby';
//Now return the cat as a string &echo it:
$catstring=$my_cat->asString();
echo "<pre>{$catstring}</pre>\n";
//and do the same as HTML
echo $my_cat->asHTML();
//NOW construct an acronym definition
$my_anac=new acronym('SCA','Society for Creative Anacronism');
//Covert it into string form:
$anac=$my_anac->asString();
echo "<pre>{$anac}</pre>\n";
//Now output as HTML:
echo $my_anac->asHTML();
?>


Output

Cat - Name:Wiley,Color:grey tabby
  • Cat
    • Name:Wiley
    • Color:grey tabby
SCA:Society for Creative Anacronism

SCA
Society for Creative Anacronism




Download for this tutorial
 

Lesson5 : Using Object Interfaces



    Abstract class as just described are powerful ways to define how new classes are constructed. Sometimes,however,you don't want to fully define a class. Instead you need to specify that classes must implement a certain set of methods. This way you can have vastly different classes created,but all define these methods and therefore can operate the same.



   The can be done by defining an interface. Interfaces are made by using the interfacekeyword instead of class and specifying public methods,just as you would have for an abstract class. Other classes can now use the implementskeyword instead of extends and state that they are going to implement all methods that the interface specified.
       The main advantage of an interface is that it allows you to define a protocol to be implemented for an object to have some behavior.For example,you could have a Comparable interface with a compare method for classes to implement,and every class that implements it would have a standardized method for comparison.




Tutorial 4 : implementing an Abstract Class


   In this way you can define a set of object that must all follow the same format,and therefore be inter-operable. Any number of classes can extend the original. The only requirements are that each child class must declare all abstract functions,and that they must declared at the same (or a less restrictive) visibility level. Beyond that,the new class may define as many other methods and properties as you want.

Saved as testing.php

<?php
//Define an abstract class for animals
abstract class animal{
//Declare variables(properties)
public $name;
//Make a constructor to be shared that requires a name
public function __construct($namesake){
$this->name=$namesake;
}
//Declare abstract methods that each animal must implement.
abstract public function makeSound();
abstract public function eat($what);
}

//Define a cat class
class cat extends animal{
public function makeSound(){
echo "Meow\n";
}
public function eat($what){
switch ($what){
case 'kibble':
case 'cat food':
case 'mouse':
case 'bird':
echo "The cat says yum!\n";
break;
case 'grass':
case 'tinsel':
case 'hair':
echo "The cat purrs contentedly.\n";
break;
default:
echo "The cat Raises its head haughtily and walks off .\n";
}
}
}

//Define a cow class
class cow extends animal{
public function makeSound(){
echo"Moooooo!\n";
}
public function eat($what){
switch($what){
case 'grass':
case'hay':
case 'salt':
echo "The cow chews its cud.\n";
break;
default:
echo "The cow walks off ignoring it.\n";
}
}
}

//Declare a cat & a cow.
$my_cat=new cat('Mimi-ow');
$my_cow=new cow('Getrude');

echo'<pre>';

//The cat says:Meow
$my_cat->makeSound();

//The cow says:Moo
$my_cow->makeSound();

//What do they each do when they eat grass?

$my_cat->eat('grass');
$my_cow->eat('grass');

echo '</pre>';
?>

output:

Meow
Moooooo!
The cat purrs contentedly.
The cow chews its cud.

Lesson 4 : Creating an Abstract Class



  
As showed in Lesson 2 ,extending classes can be a powerful tool. However,there may be times you want to create a class that must be extended to use it .Abstract classes are just this. In declaring a class to e abstract ,you can also declare functions,where you give the name and what parameters they take;however,leave the implementation up to classes that will extend this one.



   In doing this,you can define a template of how the child class must look. The child must implement all of the abstract class's abstract methods to extend it .In Short, Abstract classes allow you to define a common base for several concrete classes.



A simple example :



abstract class Animal {

abstract protected function eat();

abstract protected function sleep();

public function die() {

// Do something to indicate dying

}

}



   we define eat()and sleep()as abstract because different types of animals (e.g. lion, bear, etc.) that will inherit from Animaleat and sleep in different ways. But all animals die the same way. So we can define a common function for that. Using an abstract class helped us:
 

1.) declare some common methods that all Animals should have, and

2.) define common behavior for Animals. So, when you extend Animal, you won't have to rewrite the code for die()

Tutorial 3: Using Class Visibility operators






<?php

class cd{

public $artist;

public $title;

protected $tracks;

private $_diskId; // regularily private varible will be star

}



//Instantiate an object of class'cd'.

$mydisk=new cd();



//Now update the artist's name.

$mydisk->artist='Justic fever';

// baby,baby,baby,hoo... baby,baby,baby,hoo.... XD



//Now try to update the protected or private values

//This will cause a fatal error.

$mydisk->tracks="Boy Friend";





?>




Output:

Fatal error: Cannot access protected property cd::$tracks



Point:it is because track was declared with protected,therefore , you cannnot access it.

a Tips for Justice fever 's fans: if declare with public,you may solve the error then. (just teasing ,no offensive)

Download for this tutorial 

Lesson 3 : Concept of Protecting Object Data





  
   PHP includes a full object model ,just like other object-oriented languages,allow for visibility permissions to be set on variables and methods .The keywords for doing this and their definitions are :

Public—This declares that the variable or method is fully accessible at all times.

Private –The opposite of public ,this means that the variable or method can only be seen from inside the object itself.

Protected—A middle ground between the other two options. A variable or method declared both can be accessed from within the object itself,or from within any other class that extends this one. It cannot be accessed externally.

   All Variable declarations within the class must be included by one of these terms. Methods should also be included by one of these;however,if not specified,the default permission for methods is public.

fashion piece of the day

                                                 

                                          Fashion Piece of the day  

Hi everyone :) I hope your allright <3 Today its still keep snowing in my hometown....we have january...but its still winter and that why we still should be in winter mood  and that why todays fashion piece is.....



This warm and cute leggins in nowegian style :) 

as you can see it is available in two colors 

where to buy ---->http://www.ebay.de/itm/leggings-norweger-kleider-kleid-bunte-leggins-Winter-legins-Gr-XS-S34-36-38-/321053021103?pt=DE_Leggings&var&hash=item4ac04053af&_uhb=1#ht_6648wt_1163

I hope you liked it <3 See you tomorrow <3