Blog

  • These Are The 10 Best Restaurants in The World

    These Are The 10 Best Restaurants in The World

    Each year, fine diners, restaurateurs and food writers—I’m in the last group—try to read the annual World’s 50 Best Restaurant list like tea leaves, searching for trends, or at the very least, a coherent theme. But as in previous years, the 2014 edition, which was announced in London late last month, defies unifying logic.

    The restaurants that made the full list of 100 range from David Chang’s decidedly informal and unsedate Momofuku Ssam Bar, to Alain Ducasse’s paragon of plushness, Louis XIV, in Monaco.

    1. Noma, (Copenhagen, Denmark). Cost of a meal for two, without wine: $600.

    After losing the top ranking in 2013 (it had held the No. spot for the three previous years), Noma is firing on all cylinders these days. Located in an old whaling warehouse, the restaurant is the birthplace of “new Nordic” cuisine, which relies solely on ingredients available in region. But today, the restaurant is pushing far beyond its early days of foraged sea buckthorn and reindeer lichen.

    Dinner these days might start with a whole kohlrabi, filled with its fermented juice and bored with a straw, so that it looks and tastes like a coconut drink. The meal might then proceed through aebleskivers –a traditional Danish kind of fritter—brushed with a sauce made from fermented grasshopper, and end with a dessert of potato, almond, and plum purée.

    It sounds wacky, but somehow Redzepi and his crew manage to make it all delicious. As well as deeply pleasurable: Noma continues to offer what may well be the most engaged—and engaging—service in the world.

    Pages: 1 2 3

  • Top 10 old rock songs from the 80’s

    Top 10 old rock songs from the 80’s

    Music is an art form and cultural activity whose medium is sound organized in time.

    General definitions of music include common elements such as pitch (which governs melody and harmony), rhythm (and its associated concepts tempo, meter, and articulation), dynamics (loudness and softness), and the sonic qualities of timbre and texture (which are sometimes termed the “color” of a musical sound).

    Example Caption

    Different styles or types of music may emphasize, de-emphasize or omit some of these elements. Music is performed with a vast range of instruments and vocal techniques ranging from singing to rapping; there are solely instrumental pieces, solely vocal pieces (such as songs without instrumental accompaniment) and pieces that combine singing and instruments. The word derives from Greek μουσική (mousike; “art of the Muses”).

    Ancient Greek and Indian philosophers defined music as tones ordered horizontally as melodies and vertically as harmonies. Common sayings such as “the harmony of the spheres” and “it is music to my ears” point to the notion that music is often ordered and pleasant to listen to. However, 20th-century composer John Cage thought that any sound can be music, saying, for example, “There is no noise, only sound.”

    The creation, performance, significance, and even the definition of music vary according to culture and social context. Indeed, throughout history, some new forms or styles of music have been criticized as “not being music”, including Beethoven’s Grosse Fuge string quartet in 1825, early jazz in the beginning of the 1900s and hardcore punk in the 1980s.

  • How to make one Line Art Designs

    How to make one Line Art Designs

    There has never been a better time to buy a smartphone than right now, here in 2019, and your friends at T3 have worked tirelessly to compile a list of the cream of the crop. If you’re looking for the best phones on the market today then you are in the right place, as this guide is stuffed full of the absolute best smartphones going. 

    From the stunning Samsung Galaxy S10 Plus and super slick Apple iPhone XS Max, to the insanely fast OnePlus 7 Pro, onto the photo-taking majesty of the Huawei P30 Pro, or the movie-watching joy delivered by the Sony Xperia 1, these truly are the best mobile phones on the market today.

    So sit back, relax, and let us take you through the contenders…

    Example Caption

    Every quality phone worthy of your consideration can be found in our best phone 2019 guide – we’ve tested every aspect of each phone, from screen quality to battery life, from internal specs to camera quality. That way we can make very clear recommendations of what each phone’s strengths are and who they would be perfect partners for.

    As phones are very important tools in our everyday lives, we’ve also spent some serious time with each handset in our best phones list as well, so we can let you know exactly what, say, the Google Pixel 3a, Xiaomi Mi 9 or Huawei Mate 20 Pro smartphones are like to live with on an extended daily basis.

    We only include the absolute best phones in this list, so you can be sure you’re reading about the very latest, cutting-edge devices. We’ve listed all the phones in order of preference, too, so there’s no confusion – the first phone is the best phone that you can get in 2019.

  • Курсы по JavaScript

    JavaScript я использую давно, не могу назвать точную дату. Года с 2000, наверное. Но никогда не пытался особо в нем разобраться. То ли терпения не хватало, то ли мотивации. Довольствовался базовыми знаниями, которых хватало для примитивного решения поставленной задачи.

    Но недавно понял, наконец, что разработка на backend становится все скучнее, а все большее количество разнообразных задач переходит на сторону клиента. Поэтому решил, что надо, наконец, со всем разобраться, расставить все по полочкам.

    И записался на курс по JavaScript Ильи Кантора. Курс хороший. Начинается с базовых вещей и дает хорошую основу. Не могу сказать, что узнал много нового. Будто все уже читал это, слышал и видел. Но благодаря курсу все встало на свои места. Илья уделял много внимания особенностям языка и его реализаций, показал, как нужно использовать язык, какие инструменты стоит использовать. Кроме того, тут произошло знакомство с ES6, который, несомненно, стоит использовать! Спасибо, Илья, за те два месяца! 🙂

    certificate

  • MySQL 5.6 Developer

    Сегодня я успешно сдал экзамен MySQL 5.6 Developer 1Z0-882. И теперь жду, когда же мне присвоят Oracle Certified Professional, MySQL 5.6 Developer.

    Трудно точно оценить время, которое потратил на подготовку, так как часто приходилось прерываться на продолжительный срок по независящим от меня причинам. Думаю, суммарно где-то месяц активной подготовки.

    Сначала прочитал MySQL 5.0 Certification Study Guide (купил ее два года назад, тогда собирался сдавать соответствующий экзамен). Потом порылся немного в интернете и нашел два очень полезных поста:

    Ну, и далее мануал, мануал, мануал.

    Из рекомендаций:

    • обращайте внимание на детали синтаксиса и особенности поведения
    • находите и проходите тесты
    • больше практики
    • хорошо спите, особенно накануне экзамена

    Upd. Мой сертификат (PDF).

  • json_encode vs. serialize

    Итак, продолжение серии бесполезных исследований. В этот раз мы сравниваем несколько разные по сути функции, которые, тем не менее, часто используются с одной целью. В этом исследовании мы хотим представить массив значений (не объектов PHP) в качестве строки. Это исследование инициировал на работе Фархад Вильданов. К сожалению, ему это не помогло, так как он имел дело как раз с массивом объектов PHP.

    Что нам скажет serialize()?

    <?php
    ini_set('memory_limit', '4G');
    
    $initialArray = array_fill(0, 1000000, ['test value']);
    $start = microtime(true);
    $serializedA = serialize($initialArray);
    $end = microtime(true);
    
    echo 'serialize() string length: ' . strlen($serializedA) . PHP_EOL;
    echo 'serialize() time: ' . ($end - $start) . PHP_EOL;
    echo 'serialize() memory: ' . memory_get_peak_usage(true) . PHP_EOL;
    

    Вывод:

    serialize() string length: 36888902
    serialize() time: 0.43295097351074
    serialize() memory: 327155712
    

    Так выглядит тест для json_encode():

    <?php
    ini_set('memory_limit', '4G');
    
    $initialArray = array_fill(0, 1000000, ['test value']);
    $start = microtime(true);
    $json = json_encode($initialArray);
    $end = microtime(true);
    
    echo 'json_encode() string length: ' . strlen($json) . PHP_EOL;
    echo 'json_encode() time: ' . ($end - $start) . PHP_EOL;
    echo 'json_encode() memory: ' . memory_get_peak_usage(true) . PHP_EOL;
    

    Вывод:

    json_encode() string length: 15000001
    json_encode() time: 0.19829201698303
    json_encode() memory: 127401984
    
  • Разработка приложения с помощью Zend Framework 2

    1. Приложение необходимо разбивать на модули. Модуль включает в себя какую-то сущность и связанные с ней действия. Например, это может быть пользователь и контроллеры, отвечающие за вход/регистрацию, личный кабинет (настройки) и управление пользователями. Раньше я, разумеется, использовал модульность, но, как правило, модуль был достаточно весомым, он включал хоть и независимую (относительно) часть приложения, но все же там могли оказаться, например, и пользователи, и форум. Предложенная модель модулей в ZF2 предполагает соблюдения принципа единственной ответственности на более высоком уровне (по сравнения с классом или методом).

    2. Событийная модель — очень мощная штука. Она помогает следовать принципу единственной ответственности на более низком уровне. Простой пример: при регистрации пользователя надо отправить ему письмо (может, и что-то еще). В этом случае вы сохраняете пользователя и генерируете событие, например, “регистрация”. Все подписанные на это событие выполнят свое предназначение.

    3. Dependency Injection — об этом много и давно говорится на просторах интернета. Я рассматриваю DI с точки зрения удобства модульного тестирования, когда любую зависимость можно легко подменить моком. Например, при тестировании класса, взаимодействующего с базой данных, вам не хочется делать реальные запросы, так как вы тестируете в данный момент вовсе не это.  С другой стороны DI делает код более гибким, когда изменить используемый алгоритм не составит труда — нужно лишь передать новый объект, который будет реализовывать тот же интерфейс. Например, для создания пароля вам захочется изменить алгоритм на более надежный.

  • autotest для PHP

    Я последнее время немало человеко-часов провел в экспериментах с Руби и Рельсами (об этом я еще напишу отдельный пост). Вернувшись назад в мир разработки на PHP мне стало очень не хватать одной простой утилиты, к которой я успел так привыкнуть. Называется она autotest. Проблема в том, что она для руби. Я быстренько поискал в Гугле и на Гитхабе и не нашел ни одного решения на PHP (позже все же нашел несколько, но они мне все равно не понравились). А я верю в то, что инструменты для разработки на каком-то языке должны писаться на нем же. Хотя бы потому, что ты как разработчик на этом языке не будешь испытывать проблем, если потребуется что-то на скорую руку исправить или модифицировать. Тут руки зачесались, и я написал свой вариант автотеста.

    Прошу любить и жаловать — php.autotest.

    (more…)
  • Как отправить процесс в фоновый режим?

    Сколько лет работаю, всегда отправлял процессы в фоновый режим с помощью screen. И все бы хорошо, только вот если изначально не думаешь, что выполнение займет много времени, то велик шанс просто начать выполнять процесс. А когда захочешь пойти домой, то окажешься на распутье — то ли идти отдыхать, то ли ждать энное количество времени, когда процесс, наконец, выполнится.

    Но на деле все гораздо проще.

    Нажимаем Ctrl + Z (приостановить процесс) и набираем:

    bg

    Готово. Теперь процесс продолжил выполнение в фоновом режиме.

  • array_map(‘intval’, $array) vs. array_map(function($val) { … }, $array)

    И я продолжаю серию своих никчемных исследований…

    <?php
    ini_set('memory_limit', '4096M');
    
    $array = [];
    for ($i = 0; $i < 1000000; $i++) {
        $array[$i] = (string)$i;
    }
    
    $start = microtime(true);
    $tmp = array_map('intval', $array);
    $end = microtime(true);
    echo 'array_map(\'intval\', $array): ' . ($end - $start) . PHP_EOL;
    
    $start = microtime(true);
    $tmp = array_map(function($value) {
        return (int)$value;
    }, $array);
    $end = microtime(true);
    echo 'array_map(function($value) { ... }, $array): ' . ($end - $start) . PHP_EOL;
    array_map('intval', $array): 0.47099804878235
    array_map(function($value) { ... }, $array): 2.9696278572083