2013-02-28

Easy way to switch to HTML5'~

Apparently, everyone should be already, capable to write a websites, by using HTML5 version. But there is still a lot of people, for whom, it's hard to leave the old habits from the older versions of HTML. I thought, that I'm one of them, but a few days ago, I found the site called:



The site is nothing else, but an HTML5 templates generator, which generates for you a clean and customizable template with everything you need to have a good start. At the main site you can choose, how big, starter kit, you would like to download. The most joyful in this, is that apart of the most basic simple template, you can also download some extras, such as Apple Touch Icons, Google Analytics or JavaScript plugins.

Little, sweet menu in CSS3 with using 'nth-child'~

In CSS3, I found 'nth-child' as very useful property. See by yourself (but remember don't use IE browser, because CSS3 doesn't work as it should works on Internet Explorer!):



The code doesn't look too much complicated, because the main trick, that I used, is contained in 'nth-child':

2013-02-27

Sliding effect in CSS3 without JS help? No problem! ;)

Somebody of you can have no clue, of the possibilities that CSS3 is offered. By using only CSS3 you can get very nice effect of sliding text and make a beautiful slider. All because of special CSS3 properties, called 'transition' and 'overflow', which combined together, give the following effect:


The code is very simple:

2013-02-22

Duplicate Content Problem!~

One of the sites, that I optimize is a very peculiar case. I had already been done everything in my power to pull it into the lead in the search results. To no avail. However, the strangest thing is that the other site, was about the same subject and I have been optimizing it on the same phrases after when, the other site very quickly reached the 1st place. I had been wondering what could be the cause of this situation, so I typed in the browser, a piece of text from the page, which allegedly was written personally by my clients ..
Oh stupid Me..! How could I not think of before, that the text on the page is not unique! Although we always ask our clients to care about the original texts on the websites and if they have no ideas about it, we offer them to write unique text. But I didn't even think, that the entire text on her - my client's page (who assured us that interceded content is original created by her) will be alive and completely copied from other texts found in the network!
So I have written new texts to the site and I ping them. After, about 2 weeks, the site finally have started to move from the place. But still, site did it sluggishly and reluctantly, and finally, at one phrase, site stuck in 16th place. Her site still can;t break into the magical top ten.
And I still have no idea what the problem is in. Is it possible that using the same method of positioning the two sites, put one site (easily) in the lead, and the other may not be able to break even for the top twenty? Or maybe it's just punishment for keeping on website kilo plagiarism for so long? -, -

2013-02-21

The array_map() problems!~..

Some time ago, I had a huge problem with understanding the array_map () function. Jeffrey Way defines it as a PHP function, which is built from 2 parameters. The first is the function to execute, and the second parameter is the array, are you working with. First parameter, within array_map, executes on every item in our parameter 2, in the array. So, array_map() syntax looks like:

        array_map(function() {
                    }, array1,array2,array3,...) // required is only array1, the remaining arrays are optional

He also gave me some example of use:

     
       function array_pluck($toPluck, $arr) {
                  $ret= array_map(function($item) use ($toPluck){
                  return $item[$toPluck];
                  }, $arr);
       print_r($ret);
       }
      ?>

But, as on my first contact with this function, the example was too much complicated for me. Or maybe I could understand it just because of 'use' enclosure, which can not be used in older versions of PHP. But whether to this, I asked my boyfriend to help me, and after his lesson, I finally understood, how array_map() working. There is his example:

      
       $table = [1,2,3] // so we have an array called $table
       $new_table = array_map(function($item) { // we create a new array, equal to array_map
             return $item+1;
             }, $table); // The function within array_map(), is working on every item from the $table and for each item, adds one
       print_r($new table); //now let's print it and see the result
       ?>



RESULT:

Array(
                  [0] => 2
                  [1] => 3
                   [2] => 4)

So, as you can see, the array_map() function works on array which as components, contains other arrays with other elements. Array_map() applying to array, execute function to each one and after that, returns an array containing all this elements, that are the execute function result.

Of course, if you want to see the result of array_map(), you don't have to use print_r, which gives you a lot of, unnecessary details. You can see the result, by using nicer way, namely, using 'foreach' conditional statement:

      

        $t = ['mama', 't', 'xx'];
        $r = array_map(function($i){
               return strlen($i);
               },$t);
        foreach($r as $item) {
               echo $item.' ';
        }
        ?>

RESULT:   4 1 2